@aracna/core - v1.5.0
    Preparing search index...

    Class Logger

    The Logger class provides an isomorphic and consistent way to log messages to the console.

    • The level determines which messages are logged, the default level is warn on non-production environments and error on production environments.
    • The status determines if the logger is enabled or disabled, the default status is on on non-test environments and off on test environments.
    • The colors are on by default on non-browser environments and match the browser console colors.
    • The separator is a string used to join the arguments passed to the logger methods, the default separator is a -> symbol.

    Aracna Reference

    Index

    Constructors

    Properties

    colors: boolean

    The colors are on by default on non-browser environments and match the browser console colors.

    The level determines which messages are logged, it can be verbose, debug, info, warn or error.

    name: string

    The name is used to get the level and status from the environment variables.

    separator: string

    The separator is a string used to join the arguments passed to the logger methods.

    status: LoggerStatus

    The status determines if the logger is enabled or disabled.

    Accessors

    • get isLevelDebugDisabled(): boolean

      Checks if the debug level is disabled.

      Returns boolean

    • get isLevelVerboseDisabled(): boolean

      Checks if the verbose level is disabled.

      Returns boolean

    Methods

    • Logs a message to the console if the logger is enabled and the level is above or equal to debug.

      Parameters

      • ...args: any[]

      Returns void

    • Logs a message to the console if the logger is enabled and the level is above or equal to error.

      Parameters

      • ...args: any[]

      Returns void

    • Formats the arguments passed to the logger methods, it joins the arguments with the separator and adds the colors if enabled.

      Parameters

      Returns any[]

    • Logs a message to the console if the logger is enabled and the level is above or equal to info.

      Parameters

      • ...args: any[]

      Returns void

    • Sets the separator of the logger.

      Parameters

      • separator: string

      Returns void

    • Logs a message to the console if the logger is enabled and the level is above or equal to verbose.

      Parameters

      • ...args: any[]

      Returns void

    • Logs a message to the console if the logger is enabled and the level is above or equal to warn.

      Parameters

      • ...args: any[]

      Returns void