Skip to content

Commit

Permalink
fix: error properties handling
Browse files Browse the repository at this point in the history
gabrielelpidio committed Jan 28, 2025
1 parent 03b18c6 commit b2d5444
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/logging/src/logger.ts
Original file line number Diff line number Diff line change
@@ -85,7 +85,9 @@ export class Logger {
stack: args.stack,
name: args.name,
};
} else if (typeof args === 'object' && args !== null && Object.keys(args).length > 0) {
}

if (typeof args === 'object' && args !== null && Object.keys(args).length > 0) {
const parsedArgs = JSON.parse(JSON.stringify(args, jsonFriendlyErrorReplacer));
logEvent.fields = { ...logEvent.fields, ...parsedArgs };
} else if (args && args.length) {
2 changes: 0 additions & 2 deletions packages/logging/test/unit/transports/fetch.test.ts
Original file line number Diff line number Diff line change
@@ -203,8 +203,6 @@ describe('SimpleFetchTransport', () => {
transport.log([createLogEvent()]);
await transport.flush();

console.log(receivedHeaders);

expect(receivedHeaders.get('X-Custom-Header')).toBe('test');
expect(receivedHeaders.get('Content-Type')).toBe('application/json');
});

0 comments on commit b2d5444

Please sign in to comment.