diff --git a/src/composables/useLogger.ts b/src/composables/useLogger.ts index de3ebaa13..d63446f8e 100644 --- a/src/composables/useLogger.ts +++ b/src/composables/useLogger.ts @@ -13,12 +13,24 @@ interface LoggerComposition { export function useLogger(): LoggerComposition { function logError(...args: OneOrMore) { - args[0] = logPrefix + args[0] + if (typeof args[0] === 'string') { + // NOTE: Don't break console string substitution + args[0] = logPrefix + args[0] + } + else { + args.unshift(logPrefix) + } console.error(...args) } function logWarning(...args: OneOrMore) { - args[0] = logPrefix + args[0] + if (typeof args[0] === 'string') { + // NOTE: Don't break console string substitution + args[0] = logPrefix + args[0] + } + else { + args.unshift(logPrefix) + } console.warn(...args) }