0.1.2 • Published 6 years ago

logger-hierarchy v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

logger-hierarchy Build Status

Automatic Logging Module

Install

$ npm install logger-hierarchy

Example Usage

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()

Example Output:

Example Output

Examples:

Async functions can be logged like this: /examples/async-example.js:

Async Example Output

API

logger(arguments)

arguments

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)

License

MIT © Carlos Guerrero

0.1.2

6 years ago

0.1.1

6 years ago