Automatic Logging Module
$ npm install logger-hierarchy
const logger = require('logger-hierarchy')('moduleName');
function exampleFunction() {
var log = logger(arguments);
log.printArguments() // Add at the beginning of all functions you want to log
log.message('Something normal happened')
log.error('There was a failure')
log.warning('A friendly warning over here')
log.success('Important success!')
log.finished() // Add to the end of all functions you want to log
}
exampleFunction()
Async functions can be logged like this: /examples/async-example.js:
Arguments object of the function (JS reserved word), pass it to the logger for function name and parametters logging on the screen
(TODO: Complete API information)
MIT © Carlos Guerrero