Closed AlgoTrader closed 10 years ago
Mag uses canonical severity lavel names And by default mag-fallback just prints this names to the console. I've already written module that replaces the severity names, but did not publish it. I will publish this module in a few hours.
Oh, I have already published it=) But with some additional features like colored messages: mag-colored-output
Installation
$ npm install mag-colored-output mag-format-message mag-hub --save
Usage
var hub = require('mag-hub');
var format = require('mag-format-message');
var colored = require('mag-colored-output');
hub.pipe(format())
.pipe(colored())
.pipe(process.stdout);
var logger = require('mag')('colored-output');
logger.info('info message');
logger.debug('debug message');
To be honest - I found the long INFORMATIONAL
distracting to the point I wasn't even going to give this logging library a try.
I think it would be helpful to show your vision of the "ideal" or "real world" usage as color screenshots in the README. This might help attract developers who see things like INFORMATIONAL
and are immediately not interested.
Thanks for your feedback.
I faced with I always use either mag-colored-output
module or custom formatter to make names shorter.
So I plan to make the following changes in the next realese:
- Replace severity level names to numbers. Following spec https://tools.ietf.org/html/rfc5424 It is also reduce the size of each log object.
- Make mag-fallback module to print short names by default
@dylang @AlgoTrader Done in release https://github.com/mahnunchik/mag/tree/0.9.1
How is it possible to replace INFORMATIONAL with INFO?