Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: taro js侧日志打印改造
Browse files Browse the repository at this point in the history
Pzx-00100 committed Mar 28, 2024
1 parent c67fbae commit 50c327f
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/taro-mpharmony/src/api/network/request/index.ts
Original file line number Diff line number Diff line change
@@ -311,7 +311,7 @@ class RequestTask {
this.headersCallback.delete(callback)
} else {
// eslint-disable-next-line no-console
console.log('offHeadersReceived callback invalid')
console.debug('offHeadersReceived callback invalid')
}
}
}
6 changes: 3 additions & 3 deletions packages/taro-mpharmony/src/index.ts
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ function logFun (funObj, message) {
return new Proxy(funObj, {
apply (target, thisArg, args) {
// eslint-disable-next-line no-console
console.log(`${message}, 参数为 ${safeStringify(args)}`)
console.debug('%s, 参数为 %s', message, safeStringify(args))
return target.apply(thisArg, args)
}
})
@@ -31,7 +31,7 @@ function logObj (obj) {
const value = target[property]
// @ts-ignore
// eslint-disable-next-line no-console
console.log(`调用 native ${property} property,结果为:${safeStringify(value)} `)
console.debug('调用 native %o property,结果为:%s} ', property, safeStringify(value))
return value
}

@@ -55,7 +55,7 @@ function logObj (obj) {
const result = target[property].apply(this, args)
log = `${log}, 返回值为${safeStringify(result)}`
// eslint-disable-next-line no-console
console.log(`${log}`)
console.debug(`${log}`)
return result
}
}

0 comments on commit 50c327f

Please sign in to comment.