Fix: Log-Zeitstempel in lokaler Zeit (mit Offset) statt UTC

User-Report: Logs zeigten z.B. "17:29:43" obwohl es lokal 19:29:43 war (CEST/UTC+2), weil
alle Logger `new Date().toISOString()` (UTC "...Z") nutzten. Neuer Helper logTimestamp()
formatiert lokale Zeit mit explizitem Offset (ISO 8601, z.B. "2026-05-31T19:29:43.605+02:00")
— menschlich lokal UND weiterhin eindeutig/Date.parse-bar. Angewandt auf alle Log-Zeilen-
Writer: item-log, logger (rd_downloader.log), audit-log, rename-log, session-log,
package-log, account-rotation-log, trace-log. Interne/API-/Dateinamen-Zeitstempel
(debug-server, support-bundle, trace autoDisableAt-Config) bleiben absichtlich UTC.

Test: tests/log-timestamp.test.ts (Format + Round-Trip zum selben Instant + lokale Stunde,
TZ-unabhaengig). 650 Tests gruen, tsc 9, Build sauber.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sucukdeluxe
2026-05-31 20:10:18 +02:00
co-authored by Claude Opus 4.8
parent c4c0110f84
commit 99e4b2b885
10 changed files with 86 additions and 28 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
import fs from "node:fs";
import { logTimestamp } from "./log-timestamp";
import path from "node:path";
let logFilePath = path.resolve(process.cwd(), "rd_downloader.log");
@@ -209,7 +210,7 @@ function ensureExitHook(): void {
function write(level: "INFO" | "WARN" | "ERROR", message: string): void {
ensureExitHook();
const line = `${new Date().toISOString()} [${level}] ${message}\n`;
const line = `${logTimestamp()} [${level}] ${message}\n`;
pendingLines.push(line);
pendingChars += line.length;