Skip to content

Commit

Permalink
fix: skip logObj check for wrapped calls (fixes unjs#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored and himanshiLt committed Apr 28, 2022
1 parent 6f7bbca commit eb30408
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/consola.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,16 @@ class Consola {
_wrapLogFn (defaults) {
function logFn () {
if (paused) {
queue.push([this, defaults, arguments])
queue.push([this, defaults, arguments, true])
return
}

return this._logFn(defaults, arguments)
return this._logFn(defaults, arguments, true)
}
return logFn.bind(this)
}

_logFn (defaults, args) {
_logFn (defaults, args, isWrapped) {
if (defaults.level > this.level) {
return this._async ? Promise.resolve(false) : false
}
Expand All @@ -213,7 +213,7 @@ class Consola {
}, defaults)

// Consume arguments
if (args.length === 1 && isLogObj(args[0])) {
if (!isWrapped && args.length === 1 && isLogObj(args[0])) {
Object.assign(logObj, args[0])
} else {
logObj.args = Array.from(args)
Expand Down

0 comments on commit eb30408

Please sign in to comment.