Type alias StandardLogOptions<CustomLevelNames>

StandardLogOptions<CustomLevelNames>: {
    customLevels?: Record<CustomLevelNames, number>;
    logLevel?: number;
    reporters?: LogReporter[];
}

Type Parameters

Type declaration

  • Optional customLevels?: Record<CustomLevelNames, number>

    A map of custom log levels.

    Each logger created will have a method for each custom level.

    import { createStandardLog } from 'standard-log'

    const sl = createStandardLog({ customLevels: { foo: 100 } })
    const logger = sl.getLogger('my-logger')

    logger.foo('Hello world!') // 2020-01-01T00:00:00.000Z my-logger (FOO) Hello world!
  • Optional logLevel?: number
  • Optional reporters?: LogReporter[]

Generated using TypeDoc