ashb commented on code in PR #54433:
URL: https://github.com/apache/airflow/pull/54433#discussion_r2305299675


##########
task-sdk/src/airflow/sdk/log.py:
##########
@@ -119,6 +119,14 @@ def drop_positional_args(logger: Any, method_name: Any, 
event_dict: EventDict) -
     return event_dict
 
 
+def add_callsite_parameter(logger: Any, method_name: Any, event_dict: 
EventDict) -> EventDict:
+    record = event_dict.get("_record", None)
+    if record:
+        event_dict["filename"] = record.__dict__["pathname"]
+        event_dict["lineno"] = record.__dict__["lineno"]
+    return event_dict

Review Comment:
   This will only for for log messages that come from stdlib logging.
   
   Instead we should use 
https://www.structlog.org/en/stable/api.html#structlog.processors.CallsiteParameterAdder
 which will handle that case, and the native structlog ones for us.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to