Commit b220635 1 parent f7786e1 commit b220635 Copy full SHA for b220635
File tree 1 file changed +10
-26
lines changed
opentelemetry-sdk/src/logs
1 file changed +10
-26
lines changed Original file line number Diff line number Diff line change @@ -216,33 +216,17 @@ impl opentelemetry::logs::Logger for Logger {
216
216
cx. has_active_span ( )
217
217
. then ( || TraceContext :: from ( cx. span ( ) . span_context ( ) ) )
218
218
} ) ;
219
- // Prioritize the scenario where there is likely to be only one processor.
220
- if processors. len ( ) == 1 {
221
- // If there is exactly one processor, use the record directly.
222
- if let Some ( p) = processors. first ( ) {
223
- let mut record = record; // Move the record directly, avoiding clone.
224
- if let Some ( ref trace_context) = trace_context {
225
- record. trace_context = Some ( trace_context. clone ( ) ) ;
226
- }
227
- let data = LogData {
228
- record,
229
- instrumentation : self . instrumentation_library ( ) . clone ( ) ,
230
- } ;
231
- p. emit ( data) ;
232
- }
233
- } else {
234
- // For multiple processors, clone the record for each.
235
- for p in processors {
236
- let mut cloned_record = record. clone ( ) ;
237
- if let Some ( ref trace_context) = trace_context {
238
- cloned_record. trace_context = Some ( trace_context. clone ( ) ) ;
239
- }
240
- let data = LogData {
241
- record : cloned_record,
242
- instrumentation : self . instrumentation_library ( ) . clone ( ) ,
243
- } ;
244
- p. emit ( data) ;
219
+
220
+ for p in processors {
221
+ let mut cloned_record = record. clone ( ) ;
222
+ if let Some ( ref trace_context) = trace_context {
223
+ cloned_record. trace_context = Some ( trace_context. clone ( ) ) ;
245
224
}
225
+ let data = LogData {
226
+ record : cloned_record,
227
+ instrumentation : self . instrumentation_library ( ) . clone ( ) ,
228
+ } ;
229
+ p. emit ( data) ;
246
230
}
247
231
}
248
232
You can’t perform that action at this time.
0 commit comments