Options
All
  • Public
  • Public/Protected
  • All
Menu

Custom logger class to generate formatted log entries

Hierarchy

  • Logger

Index

Constructors

Private constructor

Properties

Private Static COLORS_PRESET

COLORS_PRESET: { black: string; blue: string; green: string; pink: string; red: string; white: string; yellow: string } = ...

Type declaration

  • black: string
  • blue: string
  • green: string
  • pink: string
  • red: string
  • white: string
  • yellow: string

Private Static DATETIME_FORMAT

DATETIME_FORMAT: string = 'dddd, mmmm dS, yyyy, hh:MM:ss TT'

Private Readonly Static INSTANCE

INSTANCE: Logger

Custom Logger instance

Methods

debug

  • debug(message: string, ...args: any[]): void

error

  • error(message: string, ...args: any[]): void

group

  • group(message: string, ...args: any[]): void

info

  • info(message: string, ...args: any[]): void

warn

  • warn(message: string, ...args: any[]): void

Static getCurrencyMessage

  • getCurrencyMessage(symbol: string, messages: string[], ...args: any[]): string
  • Parameters

    • symbol: string
    • messages: string[]
    • Rest ...args: any[]

    Returns string

Private Static getLocalTime

  • getLocalTime(format?: string, offset?: number, utc?: boolean): string
  • Parameters

    • format: string = ''
    • offset: number = 0
    • utc: boolean = false

    Returns string

Static getLogger

Static getMessage

  • getMessage(messages: string[], ...args: any[]): string
  • Parameters

    • messages: string[]
    • Rest ...args: any[]

    Returns string

Static getMessage2

  • getMessage2(messages: string[], ...args: any[]): string
  • Parameters

    • messages: string[]
    • Rest ...args: any[]

    Returns string

Private Static getOutputStyle

  • getOutputStyle(style: string): string

Static getRawMessage

  • getRawMessage(messages: string[], ...args: any[]): string
  • Parameters

    • messages: string[]
    • Rest ...args: any[]

    Returns string

Static getRawMessage2

  • getRawMessage2(messages: string[], ...args: any[]): string
  • Parameters

    • messages: string[]
    • Rest ...args: any[]

    Returns string

Private Static getTime

  • getTime(format?: string, utc?: boolean): string
  • Parameters

    • format: string = ''
    • utc: boolean = false

    Returns string

Private Static output

  • output(dateTime: string, message: string, ...args: any[]): string
  • Parameters

    • dateTime: string
    • message: string
    • Rest ...args: any[]

    Returns string