Skip to content

Commit c803194

Browse files
committed
Fix attribute merging priority order & mutation
1 parent fe4e73a commit c803194

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: packages/logger/src/Logger.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class Logger implements ClassThatLogs {
174174
* @returns {void}
175175
*/
176176
public addPersistentLogAttributes(attributes?: LogAttributes): void {
177-
this.persistentLogAttributes = merge(attributes, this.getPersistentLogAttributes());
177+
merge(this.persistentLogAttributes, attributes);
178178
}
179179

180180
/**
@@ -362,7 +362,7 @@ class Logger implements ClassThatLogs {
362362
*/
363363
private addToPowertoolLogData(...attributesArray: Array<Partial<PowertoolLogData>>): void {
364364
attributesArray.forEach((attributes: Partial<PowertoolLogData>) => {
365-
this.powertoolLogData = merge(attributes, this.getPowertoolLogData());
365+
merge(this.powertoolLogData, attributes);
366366
});
367367
}
368368

0 commit comments

Comments
 (0)