You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the very least, this behavior should be documented in the readme.
An option could be added to change this behavior. At first, the option could default to the current behavior and then the default behavior can be changed after a reasonable period.
This issue is related to #334. This open issue is also related, #711.
The text was updated successfully, but these errors were encountered:
I also had hard time to investigate why debug(error) only shows stack traces, but no other visible properties unless debug is "wrapped" with other object such as { error: error } .
My interim solution is to override createDebug.coerce() to return the value as it is.
const debug = require("debug");
debug.coerce = (val) => val;
const debugError = debug('http');
const error = new Error('hi');
error.info= { display: 'me' };
debugError(error); // now full object will be displayed.
I wish if I could use debug without such tweaking.
A quick explanation:
This is not mentioned in the readme and I had to hunt the reason for this. If an error is the first argument, it will be coerced.
debug/src/common.js
Line 82 in f66cb2d
At the very least, this behavior should be documented in the readme.
An option could be added to change this behavior. At first, the option could default to the current behavior and then the default behavior can be changed after a reasonable period.
This issue is related to #334. This open issue is also related, #711.
The text was updated successfully, but these errors were encountered: