uranusjr commented on PR #34964:
URL: https://github.com/apache/airflow/pull/34964#issuecomment-1764237332

   I wonder if it’s better to put the logic in `LoggingMixin` instead.
   
   ```python
   class LoggingMixin:
       _log: logging.Logger
       _logger_name: str | None = None
   
       @staticmethod
       def _get_log(...) -> Logger:
           if obj._log is None:
               obj._log = logging.getLogger(
                   self._logger_name if self._logger_name is not None
                   else f"{clazz.__module__}.{clazz.__name__}"
               )
           ...
   
   class Something(LoggingMixin):
       def __init__(self, ..., logger_name: str | None = None) -> None:
           ...
           self._logger_name = logger_name


-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to