[CLI] Make per-run log files unique by appending timestamp + open with mode="w" (fixes #984)#83
Merged
oxesoft merged 1 commit intoMay 20, 2026
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the logging configuration to include a timestamp in log filenames and sets the file mode to write. A review comment identifies a potential portability issue on Windows systems where the 'title' parameter might contain invalid characters like colons, and provides a code suggestion to sanitize the string.
519ae4a to
8d92cd1
Compare
antonio-amjr
requested changes
May 14, 2026
Contributor
antonio-amjr
left a comment
There was a problem hiding this comment.
Seems good, but I would like to ask for a little change if I may.
Let me know what you think of the suggestion below.
13a30a5 to
2ad05bf
Compare
antonio-amjr
approved these changes
May 20, 2026
rquidute
approved these changes
May 20, 2026
oxesoft
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #984.
Root cause:
configure_logger_for_runincertification-tool-cli/th_cli/test_run/logging.pyderived the log file pathsolely from
--title(test_run_{title}.log) andloguru.logger.add(...)defaults to append mode. Reusing
-n NAMEacross runs caused successive runsto be concatenated into the same file.
Change:
_YYYY-MM-DD-HH-MM-SS) to the log filename insideconfigure_logger_for_run, so every run produces a unique file regardlessof the
-n NAMEvalue (matches the convention suggested by @OlivierGre).mode="w"tologger.add(...)as defense-in-depth, in case two runsever land on the exact same path (e.g. same second).
No public API change;
configure_logger_for_run(title)still returns theresolved path used by
run_testsat the end of execution.Verification:
-n my_run. Two distinct files inrun_logs/,each containing only its own run.