fix: error logging (#2165)

This commit is contained in:
Aiden Cline
2025-08-21 23:27:49 -05:00
committed by GitHub
parent 08c5c401ba
commit 4fadbcfb90

View File

@@ -101,7 +101,12 @@ export namespace Log {
...extra,
})
.filter(([_, value]) => value !== undefined && value !== null)
.map(([key, value]) => `${key}=${typeof value === "object" ? JSON.stringify(value) : value}`)
.map(([key, value]) => {
const prefix = `${key}=`
if (value instanceof Error) return prefix + value.message
if (typeof value === "object") return prefix + JSON.stringify(value)
return prefix + value
})
.join(" ")
const next = new Date()
const diff = next.getTime() - last