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

Constructors

  • The constructor of the Logger class.

    Parameters

    • Optionaloptions: string | {
          debug?: boolean;
          palette?: {
              primary?: {
                  debug?: string;
                  error?: string;
                  info?: string;
                  success?: string;
                  warning?: string;
              };
              secondary?: {
                  debug?: string;
                  error?: string;
                  info?: string;
                  success?: string;
                  warning?: string;
              };
          };
          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

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.

    • Optionalobject: 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.

    • Optionalerror: 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.

    • Optionalobject: any

      An optional object to log.

    Returns void

  • Sets the options of the logger.

    Parameters

    • Optionaloptions: string | {
          debug?: boolean;
          palette?: {
              primary?: {
                  debug?: string;
                  error?: string;
                  info?: string;
                  success?: string;
                  warning?: string;
              };
              secondary?: {
                  debug?: string;
                  error?: string;
                  info?: string;
                  success?: string;
                  warning?: string;
              };
          };
          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.

    • Optionalobject: 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.

    • Optionalobject: any

      An optional object to log.

    Returns void