[logger] fix rendering of log context in testLogRecorder (#31522)

- use the processed context
- use the 'err' serializer for the 'error' field

GitOrigin-RevId: d1215e5af1f32bb1d9b5593e2644bea593daabda
This commit is contained in:
Jakob Ackermann
2026-02-12 14:52:57 +01:00
committed by Copybot
parent 05d04e864d
commit df8190ec8c
2 changed files with 7 additions and 2 deletions

View File

@@ -80,4 +80,9 @@ function getRemoteIp(req) {
return null
}
module.exports = { err: errSerializer, req: reqSerializer, res: resSerializer }
module.exports = {
err: errSerializer,
error: errSerializer,
req: reqSerializer,
res: resSerializer,
}

View File

@@ -11,7 +11,7 @@ function testLogRecorder() {
if (name in entry) entry[name] = fn(entry[name])
}
currentTest.consoleErrors = (currentTest.consoleErrors || []).concat(
JSON.stringify(info, bunyan.safeCycles())
JSON.stringify(entry, bunyan.safeCycles())
)
}
}