Options
All
  • Public
  • Public/Protected
  • All
Menu

pinus-logger

Index

Type aliases

Config

Config: Configuration & object

Configure the logger. Configure file just like log4js.json. And support ${scope:arg-name} format property setting. It can replace the placeholder in runtime. scope can be: env: environment variables, such as: env:PATH args: command line arguments, such as: args:1 opts: key/value from opts argument of configure function

param

configure file name or configure object

param

options

returns

Variables

configState

configState: object

Type declaration

  • [key: string]: any

Functions

colorize

  • colorize(str: string, style: "grey" | "blue" | "cyan" | "green" | "yellow" | "red" | "magenta" | "bold" | "italic" | "underline" | "inverse" | "white" | "black"): string
  • Taken from masylum's fork (https://github.com/masylum/log4js-node)

    Parameters

    • str: string
    • style: "grey" | "blue" | "cyan" | "green" | "yellow" | "red" | "magenta" | "bold" | "italic" | "underline" | "inverse" | "white" | "black"

    Returns string

colorizeEnd

  • colorizeEnd(style: "grey" | "blue" | "cyan" | "green" | "yellow" | "red" | "magenta" | "bold" | "italic" | "underline" | "inverse" | "white" | "black"): string
  • Parameters

    • style: "grey" | "blue" | "cyan" | "green" | "yellow" | "red" | "magenta" | "bold" | "italic" | "underline" | "inverse" | "white" | "black"

    Returns string

colorizeStart

  • colorizeStart(style: "grey" | "blue" | "cyan" | "green" | "yellow" | "red" | "magenta" | "bold" | "italic" | "underline" | "inverse" | "white" | "black"): string
  • Parameters

    • style: "grey" | "blue" | "cyan" | "green" | "yellow" | "red" | "magenta" | "bold" | "italic" | "underline" | "inverse" | "white" | "black"

    Returns string

configure

  • configure(configOrFilename: string | Config, opts: object): void
  • Parameters

    • configOrFilename: string | Config
    • opts: object

    Returns void

configureLevels

  • configureLevels(levels: object): void
  • Parameters

    • levels: object
      • [name: string]: object
        • level: string

    Returns void

configureOnceOff

  • configureOnceOff(config: Config): void

doArgs

  • doArgs(name: string, opts: any): string
  • Parameters

    • name: string
    • opts: any

    Returns string

doEnv

  • doEnv(name: string, opts: any): string
  • Parameters

    • name: string
    • opts: any

    Returns string

doOpts

  • doOpts(name: string, opts: any): string
  • Parameters

    • name: string
    • opts: any

    Returns string

doReplace

  • doReplace(src: string, opts: object): string
  • Parameters

    • src: string
    • opts: object

    Returns string

getLine

  • getLine(): string

getLogger

  • getLogger(...args: string[]): Logger
  • Parameters

    • Rest ...args: string[]

    Returns Logger

getMTime

  • getMTime(filename: string): Date
  • Parameters

    • filename: string

    Returns Date

initReloadConfiguration

  • initReloadConfiguration(filename: string, reloadSecs: number): void
  • Parameters

    • filename: string
    • reloadSecs: number

    Returns void

loadConfigurationFile

  • loadConfigurationFile(filename: string): any
  • Parameters

    • filename: string

    Returns any

reloadConfiguration

  • reloadConfiguration(): void

replaceProperties

  • replaceProperties(configObj: any, opts: object): any
  • Parameters

    • configObj: any
    • opts: object

    Returns any

Object literals

colours

colours: object

all

all: string = "grey"

debug

debug: string = "cyan"

error

error: string = "red"

fatal

fatal: string = "magenta"

info

info: string = "green"

log

log: string = "grey"

off

off: string = "grey"

trace

trace: string = "blue"

warn

warn: string = "yellow"

funcs

funcs: object

args

args: doArgs = doArgs

env

env: doEnv = doEnv

opts

opts: doOpts = doOpts

styles

styles: object

black

black: number[] = [90, 39]

blue

blue: number[] = [34, 39]

bold

bold: number[] = [1, 22]

cyan

cyan: number[] = [36, 39]

green

green: number[] = [32, 39]

grey

grey: number[] = [90, 39]

inverse

inverse: number[] = [7, 27]

italic

italic: number[] = [3, 23]

magenta

magenta: number[] = [35, 39]

red

red: number[] = [31, 39]

underline

underline: number[] = [4, 24]

white

white: number[] = [37, 39]

yellow

yellow: number[] = [33, 39]