thaliproject / Thali_CordovaPlugin

Thali p2p plugin
MIT License
226 stars 44 forks source link

Alternative for winston logger #1206

Open andrew-aladev opened 7 years ago

andrew-aladev commented 7 years ago

We are using custom transport for winston. It can will receive message and meta arguments.

logger.debug('fit'); // -> message = 'fit'; meta = {};
logger.debug(new Error('fit')); // -> message = ''; meta = new Error('fit');
logger.debug(new Error('fit'), { a : 1 }); // -> message = new Error('fit').toString(); meta = { a : 1 };

This looks looks like a bug, but this is a feature. exports.log function is full of such "features".

winston looks unreliable, we want to find a good alternative for it.

yaronyg commented 7 years ago

Now would not be the best time to switch loggers if we can avoid it. Can we patch this to detect when we are getting an Error object and toString it?

andrew-aladev commented 7 years ago

Yes, we've patched and merged it. This is a part of branch.