@@ -338,19 +338,6 @@ def dropped_attributes(self) -> int:
338338 return 0
339339
340340
341- @deprecated (
342- "Use LogRecord. Since logs are not stable yet this WILL be removed in future releases."
343- )
344- class LogData :
345- def __init__ (
346- self ,
347- log_record : LogRecord ,
348- instrumentation_scope : InstrumentationScope ,
349- ):
350- self .log_record = log_record
351- self .instrumentation_scope = instrumentation_scope
352-
353-
354341class LogRecordProcessor (abc .ABC ):
355342 """Interface to hook the log record emitting action.
356343
@@ -406,23 +393,7 @@ def add_log_record_processor(
406393
407394 def on_emit (self , log_record : LogRecord ) -> None :
408395 for lp in self ._log_record_processors :
409- # Handle backward compatibility with processors that might expect LogData
410- import inspect
411-
412- sig = inspect .signature (lp .on_emit )
413- param_name = (
414- list (sig .parameters .keys ())[0 ] if sig .parameters else None
415- )
416-
417- # Check if the processor expects LogData (backward compatibility)
418- if param_name and "log_data" in param_name .lower ():
419- # Create LogData for backward compatibility
420- log_data = LogData (
421- log_record , log_record .instrumentation_scope
422- )
423- lp .on_emit (log_data )
424- else :
425- lp .on_emit (log_record )
396+ lp .on_emit (log_record )
426397
427398 def shutdown (self ) -> None :
428399 """Shutdown the log processors one by one"""
@@ -495,26 +466,7 @@ def _submit_and_wait(
495466 future .result ()
496467
497468 def on_emit (self , log_record : LogRecord ):
498- # Handle backward compatibility with processors that might expect LogData
499- def _emit_with_compat (lp ):
500- import inspect
501-
502- sig = inspect .signature (lp .on_emit )
503- param_name = (
504- list (sig .parameters .keys ())[0 ] if sig .parameters else None
505- )
506-
507- # Check if the processor expects LogData (backward compatibility)
508- if param_name and "log_data" in param_name .lower ():
509- # Create LogData for backward compatibility
510- log_data = LogData (
511- log_record , log_record .instrumentation_scope
512- )
513- return lp .on_emit (log_data )
514- else :
515- return lp .on_emit (log_record )
516-
517- self ._submit_and_wait (lambda lp : lambda : _emit_with_compat (lp ))
469+ self ._submit_and_wait (lambda lp : lp .on_emit , log_record )
518470
519471 def shutdown (self ):
520472 self ._submit_and_wait (lambda lp : lp .shutdown )
0 commit comments