README
logger5js
a simple logger in javascript with five level.
Features:
🔥 support five log level.
🚀 custom format string or function.
🎉 set prefix label.
Installation
npm install logger5js --save-dev
Usage
1.global instance
let globalLogger = require('logger5js');
globalLogger.log(123);
globalLogger.setScope('labelA').setFormat('->%l').setLevel(3);
2.a new instance
let Logger = require('logger5js').Logger;
let logger = new Logger({name:'LabelA',level:3,format:'%l:'});
logger.setScope('labelA').setFormat('->%l').setLevel(3);
- Shortcut to create a new instance
let otherLogger = require('logger5js').scope('LabelB');