Class: logger

logger


new logger( [name])

Generic logger.
If file 'config/name.{env}.json' exists, use 'logger' configuration key.
Use mbot.logger() for integrated setup/dispose.
Parameters:
Name Type Argument Description
name string <optional>
Logger name (default 'index')
Example
var logger = mbot.load('util/logger');
var log = new logger('dir/name');

Methods


debug(msg [, cb])

Register a debug message.
Parameters:
Name Type Argument Description
msg string Message
cb function <optional>
Callback

dispose( [cb])

Dispose the logger.
Parameters:
Name Type Argument Description
cb function <optional>
Callback

error(msg [, cb])

Register an error message.
Parameters:
Name Type Argument Description
msg string Message
cb function <optional>
Callback

info(msg [, cb])

Register an information message.
Parameters:
Name Type Argument Description
msg string Message
cb function <optional>
Callback