Logging API impl for command-line usage; to be used like console.js but

  • doesn't log to stdout on log() and info() functions (using stderr instead because we output the parsing/processing result to stdout in command-line app)
  • log() will log with NOTICE priority whereas info() will log with INFO priority
  • INFO priority messages and below are suppressed
  • INFO-level logging isn't for ad-hoc messages but for "vital" messages; this is used eg. for structured log messages relating external request tokens with internally used tokens (such as request identifiers to node domain identities or thread ids etc.) and interrelating internally used tokens with each other, so these are vital to interpret a log by external tools; note as per the default priority filter for command line apps (see above), these messages aren't output as there's only one request context in command-line apps.

Constants

Name Description
log_level Enum-like filter for syslog priority with possible values ERROR, WARN, NOTICE, INFO, DEBUG, TRACE (in descending order of priority).

Member Details

debug() static

Logs text at DEBUG logging level.

error() static

Logs text at ERROR logging level.

info() static

Logs text at INFO logging level.

log() static

Logs text at LOG logging level.

log_level static

Enum-like filter for syslog priority with possible values ERROR, WARN, NOTICE, INFO, DEBUG, TRACE (in descending order of priority).

Suppresses messages with priority below NOTICE (ie. INFO, DEBUG, TRACE) by default (as per syslog defaults).

TODO: incorporate in doc/clarify where this is actually used

trace() static

Logs text at TRACE logging level.

warn() static

Logs text at WARN logging level.