File tree 2 files changed +2
-14
lines changed
packages/dd-trace/src/telemetry/logs
2 files changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ function onErrorLog (msg) {
40
40
41
41
const telLog = {
42
42
level : 'ERROR' ,
43
+ count : 1 ,
43
44
44
45
// existing log.error(err) without message will be reported as 'Generic Error'
45
46
message : message ?? 'Generic Error'
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ const logCollector = {
79
79
}
80
80
const hash = createHash ( logEntry )
81
81
if ( ! logs . has ( hash ) ) {
82
- logs . set ( hash , errorCopy ( logEntry ) )
82
+ logs . set ( hash , logEntry )
83
83
return true
84
84
} else {
85
85
logs . get ( hash ) . count ++
@@ -122,19 +122,6 @@ const logCollector = {
122
122
}
123
123
}
124
124
125
- // clone an Error object to later serialize and transmit
126
- // { ...error } doesn't work
127
- // also users can add arbitrary fields to an error
128
- function errorCopy ( error ) {
129
- const keys = Object . getOwnPropertyNames ( error )
130
- const obj = { }
131
- for ( const key of keys ) {
132
- obj [ key ] = error [ key ]
133
- }
134
- obj . count = 1
135
- return obj
136
- }
137
-
138
125
logCollector . reset ( )
139
126
140
127
module . exports = logCollector
You can’t perform that action at this time.
0 commit comments