Closed Thhethssmuz closed 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...
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 :]
Just found myself doing this everywhere:
you know to guard against the guy who just throws a string :p thought it might be useful to have a helper for this...