LoggerBase

LoggerBase

Base class for logger.

Constructor

(abstract) new LoggerBase()

Source:

Methods

(abstract) error(message, coloropt, …args) → {this}

Description:
  • Logs error message.
Source:
Parameters:
Name Type Attributes Description
message string The message.
color string <optional>
The color to be used.
args any <repeatable>
Additional arguments.
Returns:
The current instance for chaining.
Type
this

(abstract) group(label, coloropt) → {this}

Description:
  • Starts grouped output.
Source:
Parameters:
Name Type Attributes Description
label string The group label.
color string <optional>
The color to be used.
Returns:
The current instance for chaining.
Type
this

(abstract) groupCollapsed(label, coloropt) → {this}

Description:
  • Starts grouped output (collapsed by default).
Source:
Parameters:
Name Type Attributes Description
label string The group label.
color string <optional>
The color to be used.
Returns:
The current instance for chaining.
Type
this

(abstract) groupEnd() → {this}

Description:
  • Ends group output.
Source:
Returns:
The current instance for chaining.
Type
this

(abstract) info(message, coloropt, …args) → {this}

Description:
  • Logs information message.
Source:
Parameters:
Name Type Attributes Description
message string The message.
color string <optional>
The color to be used.
args any <repeatable>
Additional arguments.
Returns:
The current instance for chaining.
Type
this

isSupportedColor(color) → {boolean}

Description:
  • Returns true if the specified color is supported by the logger.
Source:
Parameters:
Name Type Description
color string The color.
Returns:
- true if the specified color is supported by the logger; otherwise, flase.
Type
boolean

(abstract) log(message, coloropt, …args) → {this}

Description:
  • Logs a message.
Source:
Parameters:
Name Type Attributes Description
message string The message.
color string <optional>
The color to be used.
args any <repeatable>
Additional arguments.
Returns:
- The current instance for chaining.
Type
this

normalizeColor(color) → {string}

Description:
  • Normalizes the specified color name, or return an empty string if it is not supported.
Source:
Parameters:
Name Type Description
color string The color.
Returns:
- The normalized color.
Type
string

(abstract) warn(message, coloropt, …args) → {this}

Description:
  • Logs warning message.
Source:
Parameters:
Name Type Attributes Description
message string The message.
color string <optional>
The color to be used.
args any <repeatable>
Additional arguments.
Returns:
The current instance for chaining.
Type
this

(static) getDefaultLogger() → {LoggerBase}

Description:
  • Detects the current environment and returns the appropriate console printer adapter.
Source:
Returns:
Type
LoggerBase

(static) isLogger(logger) → {boolean}

Description:
  • Checks if obj is an instance of a subclass of LoggerBase.
Source:
Parameters:
Name Type Description
logger any Object to test.
Returns:
True if obj is derived from LoggerBase.
Type
boolean