Interface Logger

Not Opinionated ts Logger with:

  • appId (distinguish log between multiple instances)
  • tags (tag child loggers, find & filter certain logs super-fast)
  • multiple channels output (add ur own one e.g. for parallel monitoring)
  • metadata (add any additional info to each log entry)

config to customize.

interface Logger {
    appId: string;
    channels: LogOutputRegistry;
    debug: LogMethod;
    error: LogMethod;
    info: LogMethod;
    tagged: (...tags: readonly string[]) => Logger;
    tags: readonly string[];
    warn: LogMethod;
}

Implemented by

Properties

appId: string
channels: LogOutputRegistry
debug: LogMethod
error: LogMethod
info: LogMethod
tagged: (...tags: readonly string[]) => Logger

Creates Child logger with added tags. Note: AppId and Channels are reused and remain same.

tags: readonly string[]
warn: LogMethod