1.0.3 • Published 6 years ago
loggermon v1.0.3
loggermon
Easy good looking nodejs logger
npm install loggermon --save
Usage
Options (optional)
const loggermon = require('loggermon');
// You can custom colors:
loggermon.setOptions({
infoColor: "FgBlack",
errorColor: "FgCyan",
successColor: "BgBlack",
warnColor: "FgYello"
});Logging
const loggermon = require('loggermon');
loggermon.info("Listening on localhost:3000");
loggermon.error("Something went wrong");
loggermon.success("Successfully logged into steam");
loggermon.warn("getRanNum() is deprecated please use getRandomNumber()");Logging to a text file
If you wish to put all of your logs into a text file you can use the option fileLog
Here is an example
const loggermon = require('loggermon');
loggermon.setOptions({
fileLog: "logs/logs.txt"
});
loggermon.info("Test");
loggermon.info("Test2");logs/logs.txt
Dec 21, 2019 8:45 PM - INFO - Test
Dec 21, 2019 8:45 PM - INFO - Test2| Colors |
|---|
| FgBlack |
| FgRed |
| FgGreen |
| FgYellow |
| FgBlue |
| FgMagenta |
| FgCyan |
| FgWhite |
| BgBlack |
| BgRed |
| BgGreen |
| BgYellow |
| BgBlue |
| BgMagenta |
| BgCyan |
| BgWhite |