Class Logger

The logger class, its instances will be the euber loggers.

Hierarchy

  • Logger

Constructors

  • The constructor of the Logger class.

    Parameters

    • Optional options: string | { debug?: boolean; palette?: { primary?: { info?: string | undefined; success?: string | undefined; debug?: string | undefined; warning?: string | undefined; error?: string | undefined; } | undefined; secondary?: { ...; } | undefined; }; scope?: null | string }

      The options of the logger. If you want to change only the scope you can pass it as a string.

    Returns Logger

Properties

The options passed to the logger, purged to InternalOptions.

Accessors

  • get palette(): Palette
  • The palette of the colours.

    Returns Palette

  • get scope(): null | string
  • The scope of the logger.

    Returns null | string

  • get showDebug(): boolean
  • If the debug logs will be shown.

    Returns boolean

Methods

  • Logs one or more empty lines.

    Parameters

    • n: number = 1

      The number of empty lines. Default is 1.

    Returns void

  • Logs a debug message. The format is "[DEBUG] |{SCOPE}| message |object|", where |word| is optional. If specified in the options, nothing will be logged.

    Parameters

    • message: string

      The message to be logged.

    • Optional object: any

      An optional object to log.

    Returns void

  • Logs an error message. The format is "[ERROR] |{SCOPE}| message |object|", where |word| is optional.

    Parameters

    • message: string

      The message to be logged.

    • Optional error: any

    Returns void

  • Logs one or more hr lines.

    Parameters

    • n: number = 1

      The number of hr lines to print. Default is 1.

    • color: string = 'white'

      The colour of the font. Default is 'white'.

    • symbol: string = '-'

      The symbol that constitutes the hr. Default is '-'.

    Returns void

  • Logs an info message. The format is "[INFO] |{SCOPE}| message |object|", where |word| is optional.

    Parameters

    • message: string

      The message to be logged.

    • Optional object: any

      An optional object to log.

    Returns void

  • An helper method for logging a message.

    Parameters

    • message: string

      The message text to be logged.

    • logName: string

      The log name, one of 'info', 'success', 'debug', 'warning' or 'error'. It is used for the [TAG] or the palette colour.

    • logFunction: string

      The log function, console.[function] is the function used to print the log.

    • Optional object: any

      The optional object to print with the message.

    Returns void

  • Sets the options of the logger.

    Parameters

    • Optional options: string | { debug?: boolean; palette?: { primary?: { info?: string | undefined; success?: string | undefined; debug?: string | undefined; warning?: string | undefined; error?: string | undefined; } | undefined; secondary?: { ...; } | undefined; }; scope?: null | string }

      The options for the logger.

    Returns void

  • Logs a success message. The format is "[SUCCESS] |{SCOPE}| message |object|", where |word| is optional.

    Parameters

    • message: string

      The message to be logged.

    • Optional object: any

      An optional object to log.

    Returns void

  • Logs a warning message. The format is "[WARNING] |{SCOPE}| message |object|", where |word| is optional.

    Parameters

    • message: string

      The message to be logged.

    • Optional object: any

      An optional object to log.

    Returns void

Generated using TypeDoc