mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-31 11:51:22 +00:00
fix: unify log timestamp offsets (#38904) (thanks @sahilsatralkar)
This commit is contained in:
@@ -2,7 +2,7 @@ import { setTimeout as delay } from "node:timers/promises";
|
||||
import type { Command } from "commander";
|
||||
import { buildGatewayConnectionDetails } from "../gateway/call.js";
|
||||
import { parseLogLine } from "../logging/parse-log-line.js";
|
||||
import { formatLocalIsoWithOffset, isValidTimeZone } from "../logging/timestamps.js";
|
||||
import { formatTimestamp, isValidTimeZone } from "../logging/timestamps.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { clearActiveProgressLine } from "../terminal/progress-line.js";
|
||||
import { createSafeStreamWriter } from "../terminal/stream-writer.js";
|
||||
@@ -74,16 +74,10 @@ export function formatLogTimestamp(
|
||||
return value;
|
||||
}
|
||||
|
||||
let timeString: string;
|
||||
if (localTime) {
|
||||
timeString = formatLocalIsoWithOffset(parsed);
|
||||
} else {
|
||||
timeString = parsed.toISOString();
|
||||
}
|
||||
if (mode === "pretty") {
|
||||
return timeString.slice(11, 19);
|
||||
return formatTimestamp(parsed, { style: "short", timeZone: localTime ? undefined : "UTC" });
|
||||
}
|
||||
return timeString;
|
||||
return localTime ? formatTimestamp(parsed, { style: "long" }) : parsed.toISOString();
|
||||
}
|
||||
|
||||
function formatLogLine(
|
||||
|
||||
Reference in New Issue
Block a user