Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ILogger

Hierarchy

Callable

  • ILogger(...args: any[]): void
  • A logger action.

    Parameters

    • Rest ...args: any[]

    Returns void

Index

Properties

debug

debug: LogAction

Write DEBUG message.

example
import log from '@egomobile/log'

log.debug('foo')

error

error: LogAction

Write ERROR message.

example
import log from '@egomobile/log'

log.error('foo')

info

info: LogAction

Write INFO message.

example
import log from '@egomobile/log'

log.info('foo')

trace

trace: LogAction

Write TRACE message.

example
import log from '@egomobile/log'

log.trace('foo')

warn

warn: LogAction

Write WARNING message.

example
import log from '@egomobile/log'

log.warn('foo')

Methods

filter

  • Sets a new log filter.

    example
    import log, { LogType } from '@egomobile/log'

    log.filter((type: LogType, args: any[]) => {
    // no debug or trace
    return type <= LogType.Info
    })
    throws

    LoggerMiddleware Argument is not (null) and not (undefined) and no function.

    Parameters

    Returns ILogger

reset

  • Resets that instance.

    example
    import log, { LogType } from '@egomobile/log'

    log.reset().use((type: LogType, args: any[]) => {
    // your code here
    })

    Returns ILogger

use

  • Adds one or more middlewares.

    example
    import log, { LogType } from '@egomobile/log'

    log.use((type: LogType, args: any[]) => {
    // your code here
    })
    throws

    LoggerMiddleware At least one element is not a function.

    Parameters

    Returns ILogger

Generated using TypeDoc