File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -119,22 +119,28 @@ export class ObjLogger implements IObjectLogger {
119119 return ;
120120 }
121121
122+ let paramsCopy ;
123+
124+ if ( optionalParams . length ) {
125+ paramsCopy = JSON . parse ( JSON . stringify ( optionalParams ) ) ;
126+ }
127+
122128 if ( typeof entry === "string" ) {
123129 entry = { msg : entry } ;
124130 }
125131
126- const a : any = { ...entry , level, ts : entry . ts || Date . now ( ) } ;
127-
128- a . from = entry . from || this . name ;
132+ const a : any = {
133+ ...entry ,
134+ level,
135+ ts : entry . ts || Date . now ( ) ,
136+ data : paramsCopy ,
137+ from : entry . from || this . name
138+ } ;
129139
130140 a [ this . name ] = {
131141 ...this . baseLog
132142 } ;
133143
134- if ( optionalParams . length ) {
135- a . data = optionalParams ;
136- }
137-
138144 this . outputs . forEach ( output => {
139145 if ( output . writableObjectMode ) {
140146 output . write ( a ) ;
You can’t perform that action at this time.
0 commit comments