1.3.0 • Published 10 years ago
hf-node-logger v1.3.0
hf-node-logger
Laser Fox Logger Module for Node

Installation
simple installation
npm install hf-node-loggerrequire it in your file
var logger = require('hf-node-logger')();Loglevel
There are multiple loglevel:
debug
For debugging information
info
For the 'normal' stream of events
warning
For things which are uncritical but someone should have a look
severe
For things that should not happen
critical
For things that are breaking the System
configuration
Require the module and define your loglevel.
var config = {
stdOut : console.log,
errOut : console.error,
level : DEBUG,
name : 'AppLog'
};and call the initializer which is returned by the require statement
var logger = require('hf-node-logger')(config);If you don't specify any, the default loglevel is 'info'.
usage
generic use:
logger.log(<LOGLEVEL>, <LOGTEXT>);result:
<TIMESTAMP> | <NAME> | <LOGLEVEL> | <LOGTEXT>Shortcuts
There are specified shortcuts for every loglevel:
debug
logger.debug(<LOGTEXT>);info
logger.info(<LOGTEXT>);warning
logger.warning(<LOGTEXT>);severe
logger.severe(<LOGTEXT>);critical
logger.critical(<LOGTEXT>);