loggerify
Fast, lightweight, minimalist logging framework for node.
Installation
$ npm install loggerify
Quick Start
const config = error: shouldLog: true exceptions: logFunction: consoleerror start: shouldLog: true exceptions: logFunction: consoleinfo end: shouldLog: true exceptions: logFunction: consoledebug const loggerifyMe = consoleconst loggerify = const loggerifiedFunction = loggerifyMe // function loggerifyMe started with the arguments: {}// LOG ME NOW// function loggerifyMe ended successfully
Features
- Logging as config
- Easy to use
- Wrapping Classes, objects, Functions and Arrow Functions at the same api
Motivation
Logging can become preety tough and uncomftorable, while you add more and more functions the code becoming less readable and clean. instead of doing logger.info evrey second line of code, you can use a loggerify framework that will do that for you!
Examples
const config = error: shouldLog: true exceptions: logFunction: consoleerror start: shouldLog: true exceptions: logFunction: consoleinfo end: shouldLog: true exceptions: logFunction: consoledebug const loggerify = const configuredLoggerifier =
#### Loggerify Class
{ } { console } const loggeredDog = new ; loggeredDog; //function bark started with the arguments: {}//WOOF//function bark ended successfully
#### Loggerify Object
const dog = { console } const loggeredDog = ; loggeredDog;//function bark started with the arguments: {}//WOOF//function bark ended successfully
#### Loggerify Function
{ console;} const loggeredBark = ; ;//function bark started with the arguments: {}//WOOF//function bark ended successfully
Tests
To run the test suite, first install the dependencies, then run npm test
:
$ npm install$ npm test
What's next?
- Custom log message by using function name as key
- Injecting custom log function to the function as parameter
Contributing
Feel free to open issues and to share PR's :)
People
The original author of Loggerify is Daniel Sinai