Class: ILogger

Logger Client

The Logger Client supports very efficient and configurable run-time logging to the Central Logger. Logging has a small performance overhead, so developers can liberally instrument their code with log messages for debugging and diagnostics. Which message types are enabled or disabled is fully controlled from the Central Logger - this means developers can fully instrument their code once and dynamically enable and disable logging later, as needed, for debugging or field support.

The Finsemble team uses the Central Logger to capture log message for field support. You have the option to do the same as you build your smart desktop.

Note: The Logger Client wraps all console logging (e.g., console.error, console.log) so these message can also be captured and viewed in the Central Logger, but console logging is never disabled locally. For better performance, we recommend most of your code's instrumentation be based on the Logger Client (e.g., FSBL.Clients.Logger.debug(...) instead of the console.debug(...)).

Using the Logger is similar to using the browser's console for logging (e.g., console.error or console.log), although the Logger Client is accessed through the FSBL object as shown in the examples below.

FSBL.Clients.Logger.error("an error message", anErrorObject);
FSBL.Clients.Logger.warn("a warning message", object1, object2, object3);
FSBL.Clients.Logger.log("logging message");
FSBL.Clients.Logger.info("logging message");
FSBL.Clients.Logger.log("log message");
FSBL.Clients.Logger.debug("debug message");

The Logger Client also supports system logging (e.g., Logger.system.log) for Finsemble's internal logging.

			Logger.system.info("RouterClient.transmit", "TO CHANNEL", toChannel, "EVENT", event);

Developers can view all system logging in the Central Logger, although only Logger.system.info messages (recording API interactions) are intended for use outside the Finsemble development team.

Note: Any service can also use the Logger by directing requiring the client. The Logger can immediately be used, but log message will not be transmitted to the Central Logger until Logger.start() is invoked (as shown below).

var Logger = require("../../clients/logger").default;
Logger.log("Service Ready");
Logger.start();

Methods

debug
(message, args)

Log a dev debug message.

Name Type Description
message any[]

Zero or more parameters of any type that can be stringified (e.g., string, object).

args any[]
Example
FSBL.Clients.Logger.debug("some message", parm1, parm2);

error
(message, args)

Log a dev error message.

Name Type Description
message any[]

Parameter of any type that can be stringified (e.g., string, object).

args any[]
Example
FSBL.Clients.Logger.error("some message", parm1, parm2);

info
(message, args)

Log a dev info message.

Name Type Description
message any[]

Zero or more parameters of any type that can be stringified (e.g., string, object).

args any[]
Example
FSBL.Clients.Logger.info("some message", parm1, parm2);

log
(message, args)

Log a dev log message.

Name Type Description
message any[]

Parameter of any type that can be stringified (e.g., string, object).

args any[]
Example
FSBL.Clients.Logger.log("some message", parm1, parm2);

verbose
(message, args)

Log a dev verbose message (an extra level of verbose-debug output)

Name Type Description
message any[]

Zero or more parameters of any type that can be stringified (e.g., string, object).

args any[]
Example
FSBL.Clients.Logger.verbose("some message", parm1, parm2);

warn
(message, args)

Log a dev warning message.

Name Type Description
message any[]

Parameter of any type that can be stringified (e.g., string, object).

args any[]
Example
FSBL.Clients.Logger.warn("some message", parm1, parm2);