1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-27 07:32:22 +01:00

[core] Add millisecond precision to logging timestamps (#10677)

This commit is contained in:
J. Nick Koston
2025-09-11 14:25:55 -05:00
committed by GitHub
parent 625f108183
commit 5fd64c5c89
2 changed files with 8 additions and 4 deletions

View File

@@ -226,7 +226,9 @@ def run_miniterm(config: ConfigType, port: str, args) -> int:
.replace(b"\n", b"")
.decode("utf8", "backslashreplace")
)
time_str = datetime.now().time().strftime("[%H:%M:%S]")
time_ = datetime.now()
nanoseconds = time_.microsecond // 1000
time_str = f"[{time_.hour:02}:{time_.minute:02}:{time_.second:02}.{nanoseconds:03}]"
safe_print(parser.parse_line(line, time_str))
backtrace_state = platformio_api.process_stacktrace(