Skip to content

Commit

Permalink
Log task event handlers INFO.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Dec 18, 2023
1 parent 6f62691 commit 0114783
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions cylc/flow/task_events_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,14 @@ def log_task_job_activity(ctx, workflow, point, name, submit_num=None):
# directory. In this case, just send the information to the log.
LOG.exception(exc)
LOG.info(ctx_str)
if ctx.cmd and ctx.ret_code:
LOG.error(ctx_str)
elif ctx.cmd:
LOG.debug(ctx_str)
if ctx.cmd:
if ctx.ret_code:
LOG.error(ctx_str)
else:
LOG.info(
f'Event {point}/{name}/{submit_num:02d} "{ctx.cmd_key[0][1]}"'
f" {ctx.cmd_key[0][0]}: succeeded"
)


class EventData(Enum):
Expand Down Expand Up @@ -465,8 +469,8 @@ def process_events(self, schd: 'Scheduler') -> None:
if not timer.is_timeout_set():
if timer.next() is None:
LOG.warning(
f"{point}/{name}/{submit_num:02d}"
f" handler:{key1[0]} for task event:{key1[1]} failed"
f'Event {point}/{name}/{submit_num:02d} "{key1[1]}"'
f" {key1[0]}: failed"
)
self.remove_event_timer(id_key)
continue
Expand Down Expand Up @@ -499,6 +503,11 @@ def process_events(self, schd: 'Scheduler') -> None:
timer.set_waiting()
if timer.ctx.ctx_type == self.HANDLER_CUSTOM:
# Run custom event handlers on their own
LOG.info(
f"Event {point}/{name}/{submit_num:02d}"
f' "{timer.ctx.key[1]}" {timer.ctx.key[0]}:'
f" {timer.ctx.cmd}"
)
self.proc_pool.put_command(
SubProcContext(
(key1, submit_num),
Expand Down

0 comments on commit 0114783

Please sign in to comment.