Skip to content

Commit

Permalink
Fix: log truncated
Browse files Browse the repository at this point in the history
  • Loading branch information
dcasier committed Sep 25, 2024
1 parent de3532f commit b3a807b
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 b3a807b

Please sign in to comment.