Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Logger

Index

Constructors

constructor

  • example
     // create instance
    const loggerA = new Logger();
    // create instance with name
    const loggerB = new Logger('App');
    // create instance with `displayDifferentTimestamp`
    const loggerC = new Logger('App', true);
    // create instance with `LoggerOptions`
    const loggerD = new Logger({ name: 'App' });

    Returns Logger

  • Parameters

    • name: string

    Returns Logger

  • Parameters

    Returns Logger

  • Parameters

    • name: string
    • displayDifferentTimestamp: boolean

      milliseconds since the previous log

    Returns Logger

Properties

Private logger

logger: Logger

Private options

options: LoggerOptions

Static Private cwdList

cwdList: string[] = ...

Methods

callLogger

  • callLogger(level: string, ...args: unknown[]): Logger
  • Parameters

    • level: string

      log level string

    • Rest ...args: unknown[]

      multiple log attributes that should be logged out

    Returns Logger

    winston logger instance

Private configure

  • configure(args?: string | LoggerOptions, displayDifferentTimestamp?: boolean): void
  • Parameters

    • Optional args: string | LoggerOptions

      name or logger options

    • Optional displayDifferentTimestamp: boolean

      milliseconds since the previous log

    Returns void

Private configureWithEnvironment

  • configureWithEnvironment(): void
  • overwrite default config with environment variable

    Returns void

debug

  • debug(...args: unknown[]): Logger
  • Parameters

    • Rest ...args: unknown[]

      multiple log attributes that should be logged out

    Returns Logger

    winston logger instance

error

  • error(...args: unknown[]): Logger
  • Parameters

    • Rest ...args: unknown[]

      multiple log attributes that should be logged out

    Returns Logger

    winston logger instance

fatal

  • fatal(...args: unknown[]): never
  • Fatal logging and exit process with exit code 1

    Parameters

    • Rest ...args: unknown[]

      multiple log attributes that should be logged out

    Returns never

getCallerInfo

  • getCallerInfo(index: number, error?: Error): CallerInfo
  • Parameters

    • index: number

      stack index

    • Optional error: Error

      optional Error

    Returns CallerInfo

    caller info

http

  • http(...args: unknown[]): Logger
  • Parameters

    • Rest ...args: unknown[]

      multiple log attributes that should be logged out

    Returns Logger

    winston logger instance

info

  • info(...args: unknown[]): Logger
  • Parameters

    • Rest ...args: unknown[]

      multiple log attributes that should be logged out

    Returns Logger

    winston logger instance

isEnabledColorize

log

  • log(...args: unknown[]): Logger
  • Parameters

    • Rest ...args: unknown[]

      multiple log attributes that should be logged out

    Returns Logger

    winston logger instance

silly

  • silly(...args: unknown[]): Logger
  • Parameters

    • Rest ...args: unknown[]

      multiple log attributes that should be logged out

    Returns Logger

    winston logger instance

success

  • success(...args: unknown[]): Logger
  • Parameters

    • Rest ...args: unknown[]

      multiple log attributes that should be logged out

    Returns Logger

    winston logger instance

trace

  • trace(...args: unknown[]): Logger
  • Parameters

    • Rest ...args: unknown[]

      multiple log attributes that should be logged out

    Returns Logger

    winston logger instance

verbose

  • verbose(...args: unknown[]): Logger
  • Parameters

    • Rest ...args: unknown[]

      multiple log attributes that should be logged out

    Returns Logger

    winston logger instance

warn

  • warn(...args: unknown[]): Logger
  • Parameters

    • Rest ...args: unknown[]

      multiple log attributes that should be logged out

    Returns Logger

    winston logger instance

Static getRelativePath

  • getRelativePath(filePath: string): string
  • Parameters

    • filePath: string

      absolute file path

    Returns string

    relative path string or null

Generated using TypeDoc