Properties

console: Console = window.console

Console object used to display log lines.

It can be replaced by your implementation if you want to, for example, send logs to a remote server.

Example

Logger.console = {
log: (message) => { remoteLog('LOG', message); }
warn: (message) => { remoteLog('WARN', message); }
error: (message) => { remoteLog('ERROR', message); }
}

Methods

  • Create a child logger, whose prefix will be this one's + the given string.

    Parameters

    • prefix: string

    Returns Logger

    Example

    const log = store.log.child('AppStore')
    
  • Logs a debug message, only if store.verbosity >= store.DEBUG

    Parameters

    • o: any

    Returns void

  • Logs an error message, only if store.verbosity >= store.ERROR

    Parameters

    • o: any

    Returns void

  • Logs an info message, only if store.verbosity >= store.INFO

    Parameters

    • o: any

    Returns void

  • Add warning logs on a console describing an exceptions.

    This method is mostly used when executing user registered callbacks.

    Parameters

    • context: string

      a string describing why the method was called

    • err: string | Error

    Returns void

  • Logs a warning message, only if store.verbosity >= store.WARNING

    Parameters

    • o: any

    Returns void