0.0.28 • Published 7 months ago
add_logger v0.0.28
Separate log file for each channel and log levels + aggregated log on the console
"channel" being just an arbitrary/relative grouping of logs that you use (e.g. each promise groups)
Usage:
const object = {x: 1 , y: 2}
const logger = new Logger('api_fetches');
logger.log("Log");
logger.warn("Warning", object.x);
logger.error("Error!", object);
const emailAddress = 'not+real@gmail.cc';
const emailLogger = new Logger('emails');
emailLogger.debug("Email successfully sent to ", emailAddress);
Then it will create these logs:
ls -1 logs/
--- all.debug.txt
--- all.error.txt
--- all.info.txt
--- all.warn.txt
--- api_fetches.debug.txt
--- api_fetches.error.txt
--- api_fetches.info.txt
--- api_fetches.warn.txt
--- emails.debug.txt
--- emails.error.txt
--- emails.info.txt
--- emails.warn.txt
--- nochannel.debug.txt
--- nochannel.error.txt
--- nochannel.info.txt
--- nochannel.warn.txt
new feature: multiLog: Log on multiple channels at once, to enable cross-channel debugging
const logger2 = new Logger('btcusdt', {debugMode: true});
// what if, growing candle on btcusdt? I want to log the same message
// for both channel
// option 2 - less characters
multiLog(logger1, logger2).info("Growing candles on BTCUSDT");
0.0.28
7 months ago
0.0.24
7 months ago
0.0.20
11 months ago
0.0.21
11 months ago
0.0.22
11 months ago
0.0.23
11 months ago
0.0.18
11 months ago
0.0.19
11 months ago
0.0.17
12 months ago
0.0.13
1 year ago
0.0.14
1 year ago
0.0.15
1 year ago
0.0.16
1 year ago
0.0.10
1 year ago
0.0.11
1 year ago
0.0.12
1 year ago
0.0.9
1 year ago
0.0.7
1 year ago
0.0.6
1 year ago
0.0.5
1 year ago
0.0.4
1 year ago
0.0.2
1 year ago
0.0.1
1 year ago
0.0.0
1 year ago