We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b2b393 commit f7e5cccCopy full SHA for f7e5ccc
everybody_codes/runner.py
@@ -15,7 +15,7 @@
15
16
17
class LogFormatter(logging.Formatter):
18
- def __init__(self, day: int, *args, **kwargs):
+ def __init__(self, day: int = 0, *args, **kwargs):
19
super().__init__(*args, **kwargs)
20
self.last_call = time.perf_counter_ns()
21
self.day = day
@@ -25,7 +25,10 @@ def set_part(self, part: int) -> None:
25
self.part = part
26
27
def format(self, record) -> str:
28
- return super().format(record).replace("DAYPART", f"{self.day}.{self.part}")
+ msg = super().format(record)
29
+ if "DAYPART" in msg and self.day and self.part:
30
+ msg = msg.replace("DAYPART", f"{self.day}.{self.part}")
31
+ return msg
32
33
def formatTime(self, record, datefmt=None):
34
if datefmt:
0 commit comments