From d050d4a1ad3195884ceda6f01589f0cd9b6184e8 Mon Sep 17 00:00:00 2001 From: Matthieu Baerts Date: Wed, 22 Jul 2026 19:39:39 +0200 Subject: [PATCH] cmd: log: display date along time Only displaying the time in a log file covering multiple days is confusing: when a strange pattern is found, it is required to browse around to find for which day it was. Use the ISO format instead, to display something like: 2026-07-22T19:39:39.175036 Instead of just: 19:39:39.175036 Signed-off-by: Matthieu Baerts --- core/cmd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/cmd.py b/core/cmd.py index 405a5118..64384eb2 100644 --- a/core/cmd.py +++ b/core/cmd.py @@ -71,7 +71,7 @@ def cmd_run(cmd: List[str], shell=False, include_stderr=False, add_env=None, cwd if add_env: env.update(add_env) - core.log("START", datetime.datetime.now().strftime("%H:%M:%S.%f")) + core.log("START", datetime.datetime.now().isoformat()) process = subprocess.Popen(cmd, shell=shell, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, cwd=cwd, pass_fds=pass_fds) @@ -91,7 +91,7 @@ def cmd_run(cmd: List[str], shell=False, include_stderr=False, add_env=None, cwd core.log("RETCODE", process.returncode) core.log("STDOUT", stdout) core.log("STDERR", stderr) - core.log("END", datetime.datetime.now().strftime("%H:%M:%S.%f")) + core.log("END", datetime.datetime.now().isoformat()) core.log_end_sec() if process.returncode != 0: