Options
All
  • Public
  • Public/Protected
  • All
Menu

(You should not use this class directly)

This is the logger created by the LoggerManager, it has all the methods to allow different levels of logging. Every level has a color as border for the message.

Hierarchy

  • Logger

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Logger(name: string, color: string, fixedWidth: number): Logger
  • Parameters

    • name: string

      Logger name, this is the first information written for each log created

    • color: string

      Color of the background for the name in the log. This can be any CSS color name or hexadecimal string. You can set the color also after the creation of the logger

    • fixedWidth: number

      Width of the logger name part, if passed and the name is shorter than padding will be added to reach the width

    Returns Logger

Properties

color

color: string

Methods

Private _logMessage

  • _logMessage(message: string, level: Level, ...data: any[]): Logger
  • Internal method that ask to the Display class to handle the log

    Parameters

    • message: string

      A message to print along the logger name

    • level: Level

      Level associated to the log entry

    • Rest ...data: any[]

      The optional data to log

    Returns Logger

debug

  • debug(message: string, ...data: any[]): Logger
  • This logs a message and the data with Level.DEBUG

    Parameters

    • message: string

      A message to print along the logger name

    • Rest ...data: any[]

      The optional data to log

    Returns Logger

error

  • error(message: string, ...data: any[]): Logger
  • This logs a message and the data with Level.ERROR

    Parameters

    • message: string

      A message to print along the logger name

    • Rest ...data: any[]

      The optional data to log

    Returns Logger

info

  • info(message: string, ...data: any[]): Logger
  • This logs a message and the data with Level.INFO

    Parameters

    • message: string

      A message to print along the logger name

    • Rest ...data: any[]

      The optional data to log

    Returns Logger

log

  • log(message: string, ...data: any[]): Logger
  • This logs a message and the data with Level.DEBUG

    Parameters

    • message: string

      A message to print along the logger name

    • Rest ...data: any[]

      The optional data to log

    Returns Logger

warn

  • warn(message: string, ...data: any[]): Logger
  • This logs a message and the data with Level.WARN

    Parameters

    • message: string

      A message to print along the logger name

    • Rest ...data: any[]

      The optional data to log

    Returns Logger

Generated using TypeDoc