HsiuChuanHsu commented on code in PR #53598:
URL: https://github.com/apache/airflow/pull/53598#discussion_r2288457826


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -532,7 +534,17 @@ def consume_logs(*, since_time: DateTime | None = None) -> 
tuple[DateTime | None
                                     if is_log_group_marker(message_to_log):
                                         print(message_to_log)
                                     else:
-                                        self.log.info("[%s] %s", 
container_name, message_to_log)
+                                        # Apply custom formatter or prefix 
logic
+                                        if log_formatter:
+                                            formatted_message = 
log_formatter(container_name, message_to_log)
+                                            self.log.info("%s", 
formatted_message)
+                                        else:
+                                            log_message = (
+                                                f"[{container_name}] 
{message_to_log}"
+                                                if log_prefix
+                                                else message_to_log
+                                            )
+                                            self.log.info("%s", log_message)

Review Comment:
   Agree! Make it into function `_log_message`.



-- 
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