pankajkoti commented on code in PR #32707: URL: https://github.com/apache/airflow/pull/32707#discussion_r1270983353
########## airflow/cli/commands/scheduler_command.py: ########## @@ -34,12 +35,17 @@ from airflow.utils.cli import process_subdir, setup_locations, setup_logging, sigint_handler, sigquit_handler from airflow.utils.scheduler_health import serve_health_check +log = logging.getLogger(__name__) Review Comment: yes. The example you shared is using `self.log` and not `log`. I believe this comes from extending the [LoggingMixin](https://github.com/apache/airflow/blob/main/airflow/utils/log/logging_mixin.py#L64) class which has the [log](https://github.com/apache/airflow/blob/main/airflow/utils/log/logging_mixin.py#L84) property. What I meant is in general when using `logging.getLogger(__name__)`, python modules call it as `logger` across the projects I have seen in so far. One example in our project I could find is here https://github.com/apache/airflow/blob/73b90c48b1933b49086d34176527947bd727ec85/airflow/utils/log/file_task_handler.py#L46 But I think I have another suggestion here. Since this is a CLI command I guess we could maybe use the [AirflowConsole](https://github.com/apache/airflow/blob/main/airflow/cli/simple_table.py#L39) here to print the message? e.g. https://github.com/apache/airflow/blob/main/airflow/cli/commands/connection_command.py#L360 -- 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]
