Logger

Logger

Source:
Since:
  • 2.2.0

A subset of the functionality offered by the console in a browser or Node.js, with optional special-case handlers.

Methods

error(…obj)

Called to log an error

Source:
Since:
  • 2.2.0

Conceptually like the standard console.error. If the first obj is a string, it gives the format with %-style substitution specifiers drawing from the remaining objs. This method is used to communicate extended, human-friendly details of an error condition.

Parameters:
Name Type Attributes Description
obj * <repeatable>

info(…obj)

Called to log information

Source:
Since:
  • 2.2.0

Conceptually like the standard console.info. If the first obj is a string, it gives the format with %-style substitution specifiers drawing from the remaining objs. This method is used to communicate important information not indicating any kind of problem.

Parameters:
Name Type Attributes Description
obj * <repeatable>

preinstallationCalls(callCounts)

(optional) Handler for notification of preinstallation logging calls

Source:
Since:
  • 2.2.0

If the Logger object has this method when it is installed for this library and any logging calls have previously been made, this method will be called with an Object whose properties are Logger method names and whose corresponding values are the count of times the method was called on the default logger since the last report or since the beginning of the process. Counts are only for logging done from this library. All counts are at least 1 — absence of the method name from callCounts indicates no calls.

If this method is not provided on a Logger and call counts exist to be reported, a call will be made to Logger#warn.

Parameters:
Name Type Description
callCounts Object.<string, number>

Count of calls to logging functions, by method name

trace()

Called to request logging of the current stack trace

Source:
Since:
  • 2.2.0

Conceptually like the standard console.trace. Called when call stack information might be helpful in resolving the condition that has been logged.

warn(…obj)

Called to log a warning

Source:
Since:
  • 2.2.0

Conceptually like the standard console.warn. If the first obj is a string, it gives the format with %-style substitution specifiers drawing from the remaining objs. This method is used to communicate a situation that likely indicates a problem, but for which there is defined behavior.

Parameters:
Name Type Attributes Description
obj * <repeatable>