1.0.4 • Published 1 year ago
@lx-yt/logging v1.0.4
A JavaScript logging utility.
Logger
The logger utility exposes a RootLogger with the following functions:
log(message): Allows you to log a message at the current log level.as(level): Returns a handler that logs the message at the given, predefined level. Allows you to log a message at a different level without the pitfalls of having to change the Logger's level each time.getLogger(namespace): Allows you to get - create if not present - a Logger of a specific namespace. Namespaces use dot notation for children (e.g.: '*.App.Util.Math').level(level): Sets the current log level used by thelogfunction.minLevel(level): Sets the minimum level at which messages are displayed when logging; attempts to log at a severity below this will be ignored.enabled(state): Allows you to set whether the Logger will log messages of any level or not.(level): Calling a Logger with arbitrary values allows for custom log levels without any setup, as long as they don't conflict with an already existing property.