Logger library entry point. This is a singleton object that is default exported by the library. This class is focused on being easy to use and a quick way to log anything. Just retrieve a logger with an appropiate category and start logging messages.

Example

const log = LoggerManager.getLogger("example");
log.debug("Hello World");

Constructors

Properties

consoleHijacker?: ConsoleHijacker
defaultLevel: LogLevel = LogLevel.DEBUG
levels: Map<string, LogLevel> = ...
loggers: Map<string, LoggerImpl> = ...
output: default = ...

Methods

  • Parse and apply a string containing log levels. This method is useful when using the API in a context that works with environment variables. The string must be in the following format: CATEGORY1:LEVEL1;CATEGORY2:LEVEL2;... The category "default" will be the default logger manager level. EXAMPLE: default:INFO;app.service.subservice:DEBUG;app.anotherservice.subservice:DEBUG

    Parameters

    • levels: string

    Returns void

  • Call this method after configuring logging level to update already defined loggers.

    Returns void

Generated using TypeDoc