Special version of the Stream logger, which logs errors and warnings to stderr and all other levels to stdout.

Constructor

Loggers.Stdio (config, bridge)

Parameters:

config Object
  • The configuration for the Logger
bridge Log
  • The object that triggers logging events, which we will record

Methods

cleanUpListeners ()

Undefined private

Clear the current event listeners

Returns:

Undefined:

onDebug (msg)

Undefined private

Handler for the bridges "debug" event

Parameters:

msg String
  • The message to be logged

Returns:

Undefined:

onError (e)

Undefined private

Handler for the bridges "error" event

Parameters:

e Error
  • The Error object to log

Returns:

Undefined:

onInfo (msg)

Undefined private

Handler for the bridges "info" event

Parameters:

msg String
  • The message to be logged

Returns:

Undefined:

onTrace (msg)

Undefined private

Handler for the bridges "trace" event

Parameters:

msg String
  • The message to be logged

Returns:

Undefined:

onWarning (msg)

Undefined private

Handler for the bridges "warning" event

Parameters:

msg String
  • The message to be logged

Returns:

Undefined:

setupListeners (level)

Undefined private

Clear the current event listeners and then re-listen for events based on the level specified

Parameters:

level Integer
  • The max log level that this logger should listen to

Returns:

Undefined:

write (to, label, colorize, what)

Undefined private

Sends output to a stream, does some formatting first

Parameters:

to WriteableStream
  • The stream that should receive this message
label String
  • The text that should be used at the begining of the message
colorize Function
  • A function that recieves a string and returned a colored version of it
what
  • The message to log

Returns:

Undefined: