Class Logger

Hierarchy

  • Logger

Implements

Constructors

Properties

colorFormatter: ColorFormatter = ...
formatter: LoggerFormatter[] = []
level: LoggerLevel = LoggerLevel.info

Setting a log level means only logs below or equal to this level will be handled.

logData?: LogData
removeColorFormatter: RemoveColorFormatter = ...
scope: string = ''
scopedLevel: {
    [scope: string]: LoggerLevel;
} = {}

Type declaration

scopes: {
    [scope: string]: Logger;
} = {}

Type declaration

transporter: LoggerTransport[] = []

Methods

  • Sends additional log data for the very next log/error/alert/warning/etc call.

    Example


    logger.data({user: user}).log('User logged in');

    //or

    //the given data is only used for the very next log (or error/alert/warning etc) call.
    logger.data({user: user})
    logger.log('User logged in');

    //at this point `data` is consumed, and for all other log calls not used anymore.
    logger.log('another message without data');

    Parameters

    Returns Logger

Generated using TypeDoc