Constructors

  • Returns Logger

    Remarks

    Avoid using it because you can't do anything with it.

Properties

LEVEL: LogLevel = LogLevel.ALL

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.

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']);
savingFiles: string[] = []

The files where the logs are saved.

Methods

  • Log a message in the console as a comment.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'comment'

      The title of the log.

    Returns void

    Remarks

    Using the grey color.

  • Log a message in the console as a debug.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'debug'

      The title of the log.

    Returns void

    Remarks

    Using the default color.

  • Log a message in the console as an error.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'error'

      The title of the log.

    Returns void

    Remarks

    Using the red color.

  • Log a message in the console as an event.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'event'

      The title of the log.

    Returns void

    Remarks

    Using the green color.

  • Log a message in the console as an info.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'info'

      The title of the log.

    Returns void

    Remarks

    Using the blue color.

  • Internal

    Test if a title and level is ignored.

    Parameters

    • title: string

      The title of the log.

    • level: LogLevel

      The level of the log.

    Returns boolean

    • Is it ignored or not.
  • Log a message in the console.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'log'

      The title of the log.

    • color: string = LogType.log

      The color of the log.

    Returns void

    Remarks

    Using the # color.

  • Save from now the logs in the file.

    Parameters

    • path: string

      The path of the file.

    Returns void

  • Set the color for the following text.

    Parameters

    • color: string = colors.default

      The color of the text.

    • text: string = ''

      The text to colorize.

    Returns string

    • The text colored, adapted for consoles using escape sequences.
  • Log a message in the console as a warning.

    Parameters

    • message: any

      The message to log, can be anything.

    • title: string = 'warn'

      The title of the log.

    Returns void

    Remarks

    Using the yellow color.

  • Internal

    Log something in the console and transform the ColorResolvable into an ASCII Escape Sequence containing the color.

    Parameters

    • text: any

      The text to log.

    • color: string = 'debug'

      The color of the text.

    • title: string = ''

      The title of the text.

    Returns void

  • Internal

    Returns a color in hexadecimal without the sharp from a ColorResolvable.

    Parameters

    • color: string

      The ColorResolvable.

    Returns string

    • The color.

    Remarks

    Returns the default color if it cannot be resolved.

Generated using TypeDoc