Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Logger

Index

Properties

Static LEVEL

LEVEL: LogLevel = ...

Let you set the minimum level required for a log to be sent to console.

For example if you set the level to LogLevel.LOG, the Logger.debug() and Logger.comments() methods won't log anything.

Static ignores

ignores: (string | LoggerIgnore)[] = []

Let you ignore Logs by title or by titles and levels.

example

// This will ignore any logs with the title 'mylogs'. Logger.ignores.push('mylogs');

// This will ignore any logs with the title 'mylogs', and the level 'LOG' or less. Logger.ignores.push(['mylogs', LogLevel.LOG]);

// It can also work by setting the string version of the LogLevel. Logger.ignores.push(['mylogs', 'LOG']);

Static savingFiles

savingFiles: string[] = []

The files where the logs are saved.

Methods

Static comment

  • comment(message: any, title?: string): void
  • Log a message in the console as a comment.

    remarks

    Using the grey color.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'comment'

      The title of the log.

    Returns void

Static debug

  • debug(message: any, title?: string): void
  • Log a message in the console as a debug.

    remarks

    Using the default color.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'debug'

      The title of the log.

    Returns void

Static error

  • error(message: any, title?: string): void
  • Log a message in the console as an error.

    remarks

    Using the red color.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'error'

      The title of the log.

    Returns void

Static event

  • event(message: any, title?: string): void
  • Log a message in the console as an event.

    remarks

    Using the green color.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'event'

      The title of the log.

    Returns void

Static info

  • info(message: any, title?: string): void
  • Log a message in the console as an info.

    remarks

    Using the blue color.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'info'

      The title of the log.

    Returns void

Static isIgnored

  • isIgnored(title: string, level: LogLevel): boolean
  • Test if a title and level is ignored.

    internal

    Parameters

    • title: string

      The title of the log.

    • level: LogLevel

      The level of the log.

    Returns boolean

    • Is it ignored or not.

Static log

  • log(message: any, title?: string, color?: string): void
  • Log a message in the console.

    remarks

    Using the # color.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'log'

      The title of the log.

    • color: string = ...

      The color of the log.

    Returns void

Static saveInFile

  • saveInFile(path: string): void

Static setColor

  • setColor(color?: string, text?: string): string
  • Set the color for the following text.

    Parameters

    • color: string = ...

      The color of the text.

    • text: string = ''

      The text to colorize.

    Returns string

    • The text colored, adapted for consoles using escape sequences.

Static warn

  • warn(message: any, title?: string): void
  • Log a message in the console as a warning.

    remarks

    Using the yellow color.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'warn'

      The title of the log.

    Returns void

Static Protected process

  • process(text: any, color?: string, title?: string): void
  • Log something in the console and transform the ColorResolvable into an ASCII Escape Sequence containing the color.

    internal

    Parameters

    • text: any

      The text to log.

    • color: string = 'debug'

      The color of the text.

    • title: string = ''

      The title of the text.

    Returns void

Static Private getColorFromColorResolvable

  • getColorFromColorResolvable(color: string): string
  • Returns a color in hexadecimal without the sharp from a ColorResolvable.

    remarks

    Returns the default color if it cannot be resolved.

    internal

    Parameters

    • color: string

      The ColorResolvable.

    Returns string

    • The color.

Constructors

Private constructor

Generated using TypeDoc