resumeLogs drops isRaw flag, mangling .raw() calls queued during pause
Author: tsushanthCreated Jul 21, 2026Updated Jul 21, 2026
Bug
When logs are queued during pauseLogs() and then flushed by resumeLogs(), the isRaw flag is silently dropped.
Root cause
In _wrapLogFn (src/consola.ts):
if (paused) {
queue.push([this, defaults, args, isRaw]); // isRaw stored at index 3
return;
}In resumeLogs:
for (const item of _queue) {
item[0]._logFn(item[1], item[2]); // item[3] (isRaw) never passed
}_logFn therefore receives isRaw = undefined (falsy), which activates the isLogObj branch:
if (!isRaw && args.length === 1 && isLogObj(args[0])) {
Object.assign(logObj, args[0]); // merges instead of treating as a plain argument
}Effect
A .raw() call queued during a pause—such as consola.log.raw({ message: 'hello' })—is replayed as a non-raw call. The single-argument log object is merged onto logObj rather than being passed through as an argument, producing output that differs from what an equivalent un-paused call would produce.
Fix
// resumeLogs
item[0]._logFn(item[1], item[2], item[3]); // forward isRawReproduction
import { createConsola } from 'consola';
const c = createConsola({ reporters: [{ log: obj => console.log(JSON.stringify(obj.args)) }] });
// Without pause — args are ['hello']
c.log.raw({ message: 'hello' });
// With pause/resume — args are currently [] (message got merged instead)
c.pauseLogs();
c.log.raw({ message: 'hello' });
c.resumeLogs();Source: unjs/consola