1.0.6 • Published 6 years ago
soklogs v1.0.6
Installation
Using npm
$ npm i -g npm $ npm i --save soklogs
In node js
// Load the logger class var SokLogs = require('soklogs'); // Init logger var config = { "filename": "logs.log", "path": "/Users/Test/Desktop", "date": true, "service": "Test", "size": 500 } var logger = new SokLogs(config); // Use logger logger.debug("I'm a test log", {"test": "log"}, 200);
Config documentation
- Filename: String(Required) (Name of the file).
- Path: String(Required) (Path of the file).
- Date: Boolean(Optional) (Enable or disable date display).
- Service: String(Optional) (A string who name your service.).
- Size: Int(Optional) (Specify max size of logs files in MO).
Severity
- Debug (Blue color. Example: logger.debug(logs)).
- Error (Red color. Example: logger.error(logs)).
- Info (Green color. Example: logger.info(logs)).
- Warn (Magenta color. Example: logger.warn(logs)).