-
Notifications
You must be signed in to change notification settings - Fork 250
Description
agoric-sdk/packages/internal/src/debug.js
Lines 19 to 25 in 506726b
case 'verbose': { | |
const infoTick = (optLog, ...args) => { | |
if (optLog.log) { | |
console.info(key, (debugCount += 1), ...args); | |
} else { | |
console.info(key, (debugCount += 1), optLog, ...args); | |
} |
@dtribble 's explanation of the enable = 'verbose'
case above is to ensure that even if a logger object is provided as the first argument (see #11847 and #11845 ), the log output always appears whether ses-ava or raw ava thinks an error/failure/rejection or something happened or not. The possibly obsolete ava assumption here is that t.log
itself does not log if there is no error. This used to be true of raw ava, but AFAIK no longer. Or if that configuration is available somehow, I don't know how to enable it. (I would like to! I miss it)
So in fact, the enable = 'verbose'
option does differ from the enable = true
in one observable way. When, say, a ses-ava or raw ava t
is passed in, the verbose option will still skip it, but it will send the rest of the arguments to console.info
rather than t.log
. The true option will send the rest of the arguments to t.log
. If the output always appears regardless, when should we prefer it be sent to console.info
rather than t.log
?