diff --git a/package.json b/package.json index f287d39..995d1b3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@augu/pino-transport", "description": "🐻‍❄️🌲 Pino transport that roughly matches what I like to see in my logs", - "version": "1.2.1", + "version": "1.2.2", "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ diff --git a/src/formatters/default.ts b/src/formatters/default.ts index 82bd5ca..1c14910 100644 --- a/src/formatters/default.ts +++ b/src/formatters/default.ts @@ -121,7 +121,20 @@ export class DefaultFormatter extends BaseFormatter { { buf += ' '; const attrs = Object.entries( - omit(record, ['hostname', 'level', 'msg', 'time', 'error', 'req', 'res', 'err', 'pid', 'name']) + omit(record, [ + 'hostname', + 'level', + 'msg', + 'time', + 'error', + 'req', + 'res', + 'err', + 'pid', + 'name', + 'reqId', + 'responseTime' + ]) ) .map(([key, value]) => gray(`[${key}=>${value}]`)) .join(' '); diff --git a/src/serializers/error.ts b/src/serializers/error.ts index 7abf605..f24b689 100644 --- a/src/serializers/error.ts +++ b/src/serializers/error.ts @@ -80,20 +80,23 @@ export const createErrorSerializer = const result: SerializedError = { name: error.name, message: error.message, - stack: stack - .filter((s) => !s.getFileName()?.startsWith('node:') ?? true) - .map((site) => ({ - eval_invocation: site.isEval(), - this_context: site.getTypeName() || 'Object', - constructor: site.isConstructor(), - function: site.getFunctionName() || '', - toplevel: site.isToplevel(), - native: site.isNative(), - method: site.getMethodName() || '', - file: site.getFileName() || '', - line: site.getLineNumber() || -1, - col: site.getColumnNumber() || -1 - })) + stack: + stack !== undefined + ? stack + .filter((s) => !s.getFileName()?.startsWith('node:') ?? true) + .map((site) => ({ + eval_invocation: site.isEval(), + this_context: site.getTypeName() || 'Object', + constructor: site.isConstructor(), + function: site.getFunctionName() || '', + toplevel: site.isToplevel(), + native: site.isNative(), + method: site.getMethodName() || '', + file: site.getFileName() || '', + line: site.getLineNumber() || -1, + col: site.getColumnNumber() || -1 + })) + : [] }; Object.defineProperty(result, originalErrorSymbol, {