Skip to content

Is makeTracer's 'verbose' option based on an obsolete ava assumption? #11850

@erights

Description

@erights

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?

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions