Options
All
  • Public
  • Public/Protected
  • All
Menu

The logger class, used in the package to format the logs.

Hierarchy

  • Logger

Index

Constructors

Properties

Methods

Constructors

constructor

  • The constructor of the Logger class.

    Parameters

    • options: Options

      The options given to the "generate" function. Used to determine the value of the field log.

    Returns Logger

Properties

Private log

log: boolean

If false, the log will not be logged.

Methods

error

  • error(str: string, tag?: undefined | string, path?: undefined | false | true): void
  • If the log field is true, logs a formatted error message.

    Parameters

    • str: string

      The message to log.

    • Optional tag: undefined | string

      An optional tag specifying the context of the log. Default vaue is "ERROR".

    • Optional path: undefined | false | true

      If the message to log should be formatted as path.

    Returns void

Private formatPath

  • formatPath(path: string): string
  • Given a path string, formattes its style and returns it formatted.

    Parameters

    • path: string

      The path string to format.

    Returns string

    The formatted string

info

  • info(str: string, tag?: undefined | string, path?: undefined | false | true): void
  • If the log field is true, logs a formatted info message.

    Parameters

    • str: string

      The message to log.

    • Optional tag: undefined | string

      An optional tag specifying the context of the log. Default vaue is "INFO".

    • Optional path: undefined | false | true

      If the message to log should be formatted as path.

    Returns void

succ

  • succ(str: string, tag?: undefined | string, path?: undefined | false | true): void
  • If the log field is true, logs a formatted success message.

    Parameters

    • str: string

      The message to log.

    • Optional tag: undefined | string

      An optional tag specifying the context of the log. Default vaue is "SUCCESS".

    • Optional path: undefined | false | true

      If the message to log should be formatted as path.

    Returns void

warn

  • warn(str: string, tag?: undefined | string, path?: undefined | false | true): void
  • If the log field is true, logs a formatted warning message.

    Parameters

    • str: string

      The message to log.

    • Optional tag: undefined | string

      An optional tag specifying the context of the log. Default vaue is "WARNING".

    • Optional path: undefined | false | true

      If the message to log should be formatted as path.

    Returns void

Generated using TypeDoc