Skip to content

Commit

Permalink
logging: Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
KrystalDelusion committed Mar 26, 2024
1 parent 9999871 commit 8997723
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions tests/task_loop/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def main():
tl.log_debug("line 3")

del tl.LogContext.dest_levels["varied"]
tl.LogContext.dest_levels[None] = "warning"
tl.LogContext.dest_levels[None] = "warning" # type:ignore
tl.LogContext.dest_levels[""] = "warning"
tl.log("line 4")

Expand Down Expand Up @@ -214,11 +214,7 @@ async def run_task1():
tl.logging.start_logging(file=log_output, destination_label=label)
tl.LogContext.dest_levels["mixed1"] = "info"

tl.LogContext.dest_levels["mixed2"] = {
"root": "debug",
"task1": "info",
"task2": "",
}[task]
tl.LogContext.dest_levels["mixed2"] = "debug" if task == "root" else "info"

task2 = tl.Task(on_run=run_task2)
tl.log("line 2")
Expand All @@ -239,11 +235,7 @@ async def run_task2():
tl.logging.start_logging(file=log_output, destination_label=label)
tl.LogContext.dest_levels["mixed1"] = "debug"

tl.LogContext.dest_levels["mixed2"] = {
"root": "error",
"task1": "debug",
"task2": "error",
}[task]
tl.LogContext.dest_levels["mixed2"] = "debug" if task == "task1" else "error"

tl.log_debug("line 3")

Expand Down

0 comments on commit 8997723

Please sign in to comment.