We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Tresjs
alvarosabu
Learn more about funding links in repositories.
Report abuse
1 parent a482ebe commit 3e2233cCopy full SHA for 3e2233c
src/composables/useLogger.ts
@@ -13,12 +13,24 @@ interface LoggerComposition {
13
14
export function useLogger(): LoggerComposition {
15
function logError(...args: OneOrMore<any>) {
16
- args[0] = logPrefix + args[0]
+ if (typeof args[0] === 'string') {
17
+ // NOTE: Don't break console string substitution
18
+ args[0] = logPrefix + args[0]
19
+ }
20
+ else {
21
+ args.unshift(logPrefix)
22
23
console.error(...args)
24
}
25
26
function logWarning(...args: OneOrMore<any>) {
27
28
29
30
31
32
33
34
console.warn(...args)
35
36
0 commit comments