Class: Logger
Defined in: | src/kermit/Logging.coffee |
Overview
Wrapper around LogHub that provides a method for each available log level. This allows for convenient use of the existential operator to guard log statements from ever being executed.
Note: Using the existential operator does not only prevent the log message from being sent to the appenders but actually prevents the message from being constructed! This allows to make heavy use of debug logging without introducing any GC overhead into production code.
Examples:
Lazy logging to log level 'debug'
logger = hub.logger()
logger.debug? "This String is only created if log level debug exists", {meta: "The same for any metadata"}