Skip to content

Commit

Permalink
Merge branch 'release/v0.25.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
holtwick committed Oct 17, 2024
2 parents 020153a + 2944c55 commit 67b9ea1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zeed",
"type": "module",
"version": "0.25.0",
"version": "0.25.1",
"description": "🌱 Simple foundation library",
"author": {
"name": "Dirk Holtwick",
Expand Down
2 changes: 2 additions & 0 deletions src/common/data/convert.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Uint8ArrayToHexDump } from './bin'
import { objectPlain } from './object'

// import { jsonStringify } from './json'

Expand Down Expand Up @@ -111,6 +112,7 @@ export function formatMessages(
return `${obj.name || 'Error'}: ${obj.message}\n${obj.stack}`
}
try {
obj = objectPlain(obj)
return pretty ? JSON.stringify(obj, null, 2) : JSON.stringify(obj)
}
catch (err) {}
Expand Down
6 changes: 5 additions & 1 deletion src/common/log/log-memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export function LoggerMemoryHandler(

msg.timestamp ??= getTimestamp()

const m = objectPlain(msg, { maxDepth, errorTrace })
const m = objectPlain(msg, {
maxDepth,
errorTrace,
keepAsIs: v => v instanceof Error,
})

if (compact === true)
(messages as LogMessageCompact[]).push([m.timestamp, m.level, m.name, ...m.messages])
Expand Down

0 comments on commit 67b9ea1

Please sign in to comment.