Module Separated Logger.
👏 Screenshots
Please view test.js.
🌟 Features
-
Module separated.
-
Log to the file and the console at the same time. (Or log to one only.)
-
Printing with chalk.
-
Log with different timestamp in different destinations.
-
TypeScript friendly.
💨 Install
Install with yarn:
yarn add plugog
Install with npm:
npm i -S plugog
👉 Usage
Import and create Plugog instance:
const Plugog = const plugog =
Optionally, specify a file to log in:
const fs = const stream = fsconst plugog = stream
Add a plugin:
const log = plugog
Plugog is now ready! Use the logging methods below like:
log
INF
log(), inf(), info(), l(), i(), m(), msg(), message(), blue(), b()
Color: Cyan
Console Format: INF|22:18:05|core Info Test.
Log File Format: [2020/2/7 22:18:05][INF][core]Info Test.
ERR
err(), error(), e(), fatal(), stop(), red(), r()
Color: Red
Console Format: ERR|22:18:05|core Error Test.
Log File Format: [2020/2/7 22:18:05][ERR][core]Error Test.
OK
ok(), o(), s(), success(), ready(), green(), g()
Color: Green
Console Format: OK |22:18:05|core Success Test.
Log File Format: [2020/2/7 22:18:05][OK ][core]Success Test.
WRN
warn(), wrn(), w(), warning(), orange(), yellow()
Color: Yellow
Console Format: WRN|14:43:00|core Warn Test.
Log File Format: [2020/2/10 14:43:00][WRN][core]Warn Test.
💬 BUGs & Issues
Feel free to open issues.
💻 Contributions
PRs are welcome! Feel free to contribute on this project.
⚠ LICENSE
MIT