mahnunchik / mag

Mag is the streaming logger for NodeJS
https://npmjs.org/mag
MIT License
54 stars 3 forks source link

Too long level names #3

Closed AlgoTrader closed 10 years ago

AlgoTrader commented 10 years ago

How is it possible to replace INFORMATIONAL with INFO?

mahnunchik commented 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.

mahnunchik commented 10 years ago

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');
dylang commented 10 years ago

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.

mahnunchik commented 10 years ago

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:

  1. Replace severity level names to numbers. Following spec https://tools.ietf.org/html/rfc5424 It is also reduce the size of each log object.
  2. Make mag-fallback module to print short names by default
mahnunchik commented 10 years ago
  1. Replace severity level names to numbers. Following spec https://tools.ietf.org/html/rfc5424 It is also reduce the size of each log object.
  2. Make mag-fallback module to print short names by default

@dylang @AlgoTrader Done in release https://github.com/mahnunchik/mag/tree/0.9.1