Skip to content

Commit c743eb0

Browse files
committed
feat: use lodash.merge for merging ordered & base order attributes
1 parent 4f3967f commit c743eb0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/logger/src/formatter/PowertoolsLogFormatter.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import merge from 'lodash.merge';
12
import type { LogAttributes, PowertoolsLog } from '../types/Log.js';
23
import type { UnformattedAttributes } from '../types/Logger.js';
34
import { LogFormatter } from './LogFormatter.js';
@@ -48,10 +49,7 @@ class PowertoolsLogFormatter extends LogFormatter {
4849

4950
// Merge the ordered attributes with the rest of the attributes
5051
const powertoolsLogItem = new LogItem({
51-
attributes: {
52-
...orderedAttributes,
53-
...baseAttributes,
54-
},
52+
attributes: merge(orderedAttributes, baseAttributes),
5553
});
5654

5755
powertoolsLogItem.addAttributes(additionalLogAttributes);

0 commit comments

Comments
 (0)