logs: Change the timestamp format to ISO 8601 UTC

Resolves: #2608
Change-type: major
This commit is contained in:
Thodoris Greasidis 2023-05-12 18:59:11 +03:00
parent ca80bd52fe
commit adb460b270

View File

@ -155,12 +155,8 @@ export function displayLogObject<T extends Log>(
system: boolean,
filterServices?: string[],
): void {
let toPrint: string;
if (obj.timestamp != null) {
toPrint = `[${new Date(obj.timestamp).toLocaleString()}]`;
} else {
toPrint = `[${new Date().toLocaleString()}]`;
}
const d = obj.timestamp != null ? new Date(obj.timestamp) : new Date();
let toPrint = `[${d.toISOString()}]`;
if (obj.serviceName != null) {
if (filterServices) {