From: Chris Duncan Date: Sun, 12 Jul 2026 07:58:23 +0000 (-0700) Subject: Append first log argument to datetime string to allow color support in later args. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=ff52d5435ead104a38555af6b19c350ff2b4680c;p=nano-pow.git Append first log argument to datetime string to allow color support in later args. --- diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 632ae29..bf63b87 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -36,7 +36,8 @@ export class Logger { } } } - const entry = `${datetime} ${globalThis.process?.title ?? 'NanoPow'}[${globalThis.process?.pid ?? 'browser'}]:` + const entry = `${datetime} ${globalThis.process?.title ?? 'NanoPow'}[${globalThis.process?.pid ?? 'browser'}]: ${args[0]}` + args = args.slice(1) console.log(entry, ...args) globalThis.process?.send?.({ type: 'console', data: `${entry} ${args}` }) }