clux / logule

A multi-transport, peer-dependent logging library for nodejs - UNMAINTAINED
MIT License
35 stars 5 forks source link

logging stack traces #23

Closed Thhethssmuz closed 9 years ago

Thhethssmuz commented 9 years ago

Just found myself doing this everywhere:

log.error(err instanceof Error ? err.stack : new Error(err).stack);

you know to guard against the guy who just throws a string :p thought it might be useful to have a helper for this...

clux commented 9 years ago

Per discussion, instead unfroze Logger.prototype so this can be done in your own code. This is not using Logger's state so shouldn't really be in there. Blaming stupid libraries that you use :]