Skip to content

Commit

Permalink
Merge pull request avocado-framework#3822 from PaulYuuu/fix-log-trunc…
Browse files Browse the repository at this point in the history
…ated

fix(utils_logfile.log_line): Open file with 'a' mode for safer writing
  • Loading branch information
luckyh authored Jan 8, 2024
2 parents 26cc872 + 60a0e81 commit fb0bc42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion virttest/utils_logfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def log_line(filename, line):
os.makedirs(os.path.dirname(log_file))
except OSError:
pass
_open_log_files[base_file] = open(log_file, "w")
_open_log_files[base_file] = open(log_file, "a")
timestr = time.strftime("%Y-%m-%d %H:%M:%S")
try:
line = string_safe_encode(line)
Expand Down

0 comments on commit fb0bc42

Please sign in to comment.