Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConsoleLogger

ConsoleLogger writes logs with console

  // working with the ConsoleLogger
  const logger = new ConsoleLogger('demo'); //default level is LogLevel.WARN
  logger.info('info');
  logger.debug('debug');
  logger.warn('warn');
  logger.error('error');

  // setting logging levels
  const logger = new ConsoleLogger('demo', LogLevel.INFO)
  logger.debug(debugFunc()); // this will not show up
  logger.setLogLevel(LogLevel.DEBUG)
  logger.debug(debugFunc()); // this will show up

Hierarchy

  • ConsoleLogger

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

level

level: LogLevel

name

name: string

Methods

debug

  • debug(debugFunction: string | (() => string)): void
  • Calls [[debugFunction]] only if the log level is debug and emits the resulting string. Use the debug level to dump large or verbose messages that could slow down performance.

    Parameters

    • debugFunction: string | (() => string)

    Returns void

error

  • error(msg: string): void

getLogLevel

info

  • info(msg: string): void

setLogLevel

warn

  • warn(msg: string): void

Generated using TypeDoc