1.0.2 • Published 5 years ago
edisga-customlogger v1.0.2
This was created for internal project
How to import
var logger = require('edisga-customlogger');
How to use it
This will send the output to console.log following the next syntax:
{
category: category,
code: code,
date: moment().format(),
custom: custom,
method:method
}
logger.stdout("app", 1, "Listening on " + config.port ,"app.listen")
And the following for error:
{
category: category,
code: code,
date: moment().format(),
error: {
name: err.name,
message: err.message
},
custom: custom,
method:method
}
logger.stderr("db", 500 , err, "Db client was not able to connect.", "dbconnect")