Class: Logger

Logger Client

The Logger Client supports very efficent 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. By default, only error and warning messages are captured by the Logger, with the other message types (e.g., log, info, debug) disabled. 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. Finsemble customers, building their own Finsemble applications, have the option to do the same.

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", anErrorOject);
            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. All Finsemble client APIs are in the process of being instrumented to log their entry-point calls and parameters, as shown below.

            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");
            Logger.log("Service Ready");
            Logger.start();

Methods

debug
(messageParm)
clients/logger.js, line 380

Log a dev debug message.

Name Type Description
messageParm * repeatable

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

Example
FSBL.Clients.Logger.debug("some message", parm1, parm2);

error
(messageParm)
clients/logger.js, line 287

Log a dev error message.

Name Type Description
messageParm * repeatable

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

Example
FSBL.Clients.Logger.error("some message", parm1, parm2);

info
(messageParm)
clients/logger.js, line 330

Log a dev info message.

Name Type Description
messageParm * repeatable

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

Example
FSBL.Clients.Logger.info("some message", parm1, parm2);

log
(messageParm)
clients/logger.js, line 355

Log a dev log message.

Name Type Description
messageParm * repeatable

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

Example
FSBL.Clients.Logger.log("some message", parm1, parm2);

verbose
(messageParm)
clients/logger.js, line 405

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

Name Type Description
messageParm * repeatable

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

Example
FSBL.Clients.Logger.verbose("some message", parm1, parm2);

warn
(messageParm)
clients/logger.js, line 307

Log a dev warning message.

Name Type Description
messageParm * repeatable

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

Example
FSBL.Clients.Logger.warn("some message", parm1, parm2);