Options
All
  • Public
  • Public/Protected
  • All
Menu

The Logger interface used for logging. You can get a Logger from LoggerFactory. LoggerFactory itself you create and configure through LFService.

There are two ways of logging things.

The normal way using: trace, debug, info, warn, error, fatal, all of these methods expect at least an error message, optionally an Error.

Sample: logger.debug("Hello world"); logger.error("This is an error", new Error("fail"));

Using closures: tracec, debugc, infoc, warnc, errorc, fatalc (note the c for closure). These methods expect a closure for the message, and optionally one for the Error. The latter can be very useful if you have something expensive to log, and only really want to log it when the logger framework will log it. In addition you can use the closure one to do special things.

Sample: logger.debugc(() => "Hello world"); logger.errorc(() => "Very expensive " + obj.toDoThis(), () => new Error("Oops")); logger.fatalc(() => { // Do something amazingly custom here return "My Error Message"; });

Hierarchy

  • Logger

Implemented by

Index

Properties

name

name: string

Name of this logger (the name it was created with).

Methods

debug

debugc

  • debugc(msg: function, error?: undefined | function): void
  • deprecated

    Since 0.5.0, will be removed in 0.6.0, use debug instead.

    Parameters

    • msg: function
    • Optional error: undefined | function

    Returns void

error

errorc

  • errorc(msg: function, error?: undefined | function): void
  • deprecated

    Since 0.5.0, will be removed in 0.6.0, use error instead.

    Parameters

    • msg: function
    • Optional error: undefined | function

    Returns void

fatal

fatalc

  • fatalc(msg: function, error?: undefined | function): void
  • deprecated

    Since 0.5.0, will be removed in 0.6.0, use fatal instead.

    Parameters

    • msg: function
    • Optional error: undefined | function

    Returns void

getLogLevel

info

infoc

  • infoc(msg: function, error?: undefined | function): void
  • deprecated

    Since 0.5.0, will be removed in 0.6.0, use info instead.

    Parameters

    • msg: function
    • Optional error: undefined | function

    Returns void

isDebugEnabled

  • isDebugEnabled(): boolean

isErrorEnabled

  • isErrorEnabled(): boolean

isFatalEnabled

  • isFatalEnabled(): boolean

isInfoEnabled

  • isInfoEnabled(): boolean

isTraceEnabled

  • isTraceEnabled(): boolean

isWarnEnabled

  • isWarnEnabled(): boolean

trace

tracec

  • tracec(msg: function, error?: undefined | function): void
  • deprecated

    Since 0.5.0, will be removed in 0.6.0, use trace instead.

    Parameters

    • msg: function
    • Optional error: undefined | function

    Returns void

warn

warnc

  • warnc(msg: function, error?: undefined | function): void
  • deprecated

    Since 0.5.0, will be removed in 0.6.0, use warn instead.

    Parameters

    • msg: function
    • Optional error: undefined | function

    Returns void

Generated using TypeDoc