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

error

  • error(msg: string): void

getLogLevel

info

  • info(msg: string): void

setLogLevel

warn

  • warn(msg: string): void

Generated using TypeDoc