ZEST / base.logger / Module: base-logger/formatter

base-logger/formatter

require("base-logger/formatter")(group) → {module:base-logger/formatter~Formatter}

This function returns a formatter function which is used to format logs

Parameters:
Name Type Description
group string

the log group

Properties:
Name Type Argument Description
pattern string | module:base-logger~LogPattern <optional>

the pattern used for formatting the logs. If the value is a string, the same pattern will be used for logging debug, info, warn and error messages. See module:base-logger~LogPattern for details on how patterns are used.

Source:
Returns:

the formatter function

Type
module:base-logger/formatter~Formatter

format module is used to format log messages with a pattern.

Source:

Requires

Type Definitions

Formatter(time, logLevel, args) → {string}

The formatter function is used to format objects into a loggable string

Parameters:
Name Type Description
time Date

the logging time

logLevel string

the level of the logger message

args Array.<*>

the objects or Strings to log

Source:
Returns:

the parsed and formatted logggable string

Type
string