Skip to content

Commit

Permalink
Use logger to print message during task execution. (#22488)
Browse files Browse the repository at this point in the history
  • Loading branch information
kosteev authored Mar 25, 2022
1 parent 388f4e8 commit acb1a10
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion airflow/cli/commands/task_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
from airflow.utils.session import NEW_SESSION, create_session, provide_session
from airflow.utils.state import DagRunState

log = logging.getLogger(__name__)

CreateIfNecessary = Union[Literal[False], Literal["db"], Literal["memory"]]


Expand Down Expand Up @@ -364,7 +366,7 @@ def task_run(args, dag=None):

hostname = get_hostname()

print(f"Running {ti} on host {hostname}")
log.info("Running %s on host %s", ti, hostname)

if args.interactive:
_run_task_by_selected_method(args, dag, ti)
Expand Down

0 comments on commit acb1a10

Please sign in to comment.