File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
- """Utilities for intercepting logs in worker processes and handling these in the Launcher."""
1
+ """Utilities for intercepting logs in worker processes and handling these in the Launcher.""" # noqa: A005
2
2
3
3
from __future__ import annotations
4
4
@@ -75,6 +75,7 @@ def stream_handler(
75
75
"%(asctime)s:%(levelname)s:%(hostname)s[%(local_rank)s]: %(message)s"
76
76
if local_rank is not None
77
77
else "%(asctime)s:%(levelname)s:%(hostname)s: %(message)s" ,
78
+ datefmt = "%Y-%m-%d %H:%M:%S" ,
78
79
),
79
80
)
80
81
return handler
@@ -89,8 +90,9 @@ def file_handler(
89
90
"""Handler builder function for writing logs from specified hostname/rank to a file."""
90
91
handler = logging .FileHandler (file_path )
91
92
add_filter_to_handler (handler , hostname , local_rank , log_level = log_level )
92
- formatter = logging .Formatter ("%(asctime)s:%(levelname)s: %(message)s" )
93
- handler .setFormatter (formatter )
93
+ handler .setFormatter (
94
+ logging .Formatter ("%(asctime)s:%(levelname)s: %(message)s" , datefmt = "%Y-%m-%d %H:%M:%S" )
95
+ )
94
96
return handler
95
97
96
98
You can’t perform that action at this time.
0 commit comments