Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Logger

Hierarchy

  • Logger

Implements

Index

Constructors

constructor

  • new Logger(context?: string, isTimestampEnabled?: boolean): Logger

Properties

Protected Optional context

context: string

Private Readonly isTimestampEnabled

isTimestampEnabled: boolean

Static Private Optional instance

instance: typeof Logger | LoggerService = Logger

Static Private Optional lastTimestamp

lastTimestamp: number

Static Private logLevels

logLevels: LogLevel[] = ['log','error','warn','debug','verbose',]

Methods

Private callFunction

  • callFunction(name: "log" | "warn" | "debug" | "verbose", message: any, context?: string): void

debug

  • debug(message: any, context?: string): void

error

  • error(message: any, trace?: string, context?: string): void

Private getInstance

Private isLogLevelEnabled

  • isLogLevelEnabled(level: LogLevel): boolean

log

  • log(message: any, context?: string): void

setContext

  • setContext(context: string): void

verbose

  • verbose(message: any, context?: string): void

warn

  • warn(message: any, context?: string): void

Static debug

  • debug(message: any, context?: string, isTimeDiffEnabled?: boolean): void

Static error

  • error(message: any, trace?: string, context?: string, isTimeDiffEnabled?: boolean): void

Static log

  • log(message: any, context?: string, isTimeDiffEnabled?: boolean): void

Static overrideLogger

Static Private printMessage

  • printMessage(message: any, color: (message: string) => string, context?: string, isTimeDiffEnabled?: boolean): void
  • Parameters

    • message: any
    • color: (message: string) => string
        • (message: string): string
        • Parameters

          • message: string

          Returns string

    • Default value context: string = ""
    • Optional isTimeDiffEnabled: boolean

    Returns void

Static Private printStackTrace

  • printStackTrace(trace: string): void

Static Private updateAndGetTimestampDiff

  • updateAndGetTimestampDiff(isTimeDiffEnabled?: boolean): string

Static verbose

  • verbose(message: any, context?: string, isTimeDiffEnabled?: boolean): void

Static warn

  • warn(message: any, context?: string, isTimeDiffEnabled?: boolean): void

Generated using TypeDoc