Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Logger

A logger function which only logs only is the level of the message is greater than or equal to the log level specificd in the config. Strings support Chalk template literals.

Hierarchy

  • Logger

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private config

config: Config

The Config object provided to this instance.

Methods

Private chalk

debug

  • debug(...messages: any | Array<any>): void
  • Logs all messages useful while debugging specially. Useful for providing more context to advanced users.

    argument

    {any|any[]} messages

    Parameters

    • Rest ...messages: any | Array<any>

    Returns void

error

  • error(...messages: any | Array<any>): void
  • Logs a critical message. Does not exit the process.

    argument

    {any|any[]} messages

    Parameters

    • Rest ...messages: any | Array<any>

    Returns void

fatal

  • fatal(error: any | Array<any>): void
  • Log a critical message. This exits the process.

    argument

    {any} error - Any valid error instance.

    Parameters

    • error: any | Array<any>

    Returns void

info

  • info(...messages: any | Array<any>): void
  • Logs an informative message. Useful for general logging purposes.

    argument

    {any|any[]} messages

    Parameters

    • Rest ...messages: any | Array<any>

    Returns void

Private print

  • print(message: any | Array<any>, level: LogLevels, prefix: string): void
  • The is the internal print function used by the logger to check the logLevel and print messages to the terminal.

    Parameters

    • message: any | Array<any>

      An item to be printed to the terminal.

    • level: LogLevels

      The level of the log.

    • prefix: string

      The string to prefix the log message with.

    Returns void

warn

  • warn(...messages: any | Array<any>): void
  • Logs a warning. Used to highlight cause of problems.

    argument

    {any|any[]} messages

    Parameters

    • Rest ...messages: any | Array<any>

    Returns void

Generated using TypeDoc