Skip to content

Commit

Permalink
Merge pull request #81 from dcasier/fix-log
Browse files Browse the repository at this point in the history
Fix: log truncated
  • Loading branch information
maurizio-lombardi authored Oct 1, 2024
2 parents de3532f + b3a807b commit 4fb5534
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion configshell/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def _append(self, msg, level):
date_fields[3], date_fields[4], date_fields[5])

if self.prefs['logfile']:
Path(self.prefs['logfile']).write_text(f"[{level}] {date} {msg}\n")
with Path(self.prefs['logfile']).open(mode="a") as f:
f.write(f"[{level}] {date} {msg}\n")

def _log(self, level, msg):
'''
Expand Down

0 comments on commit 4fb5534

Please sign in to comment.