diff --git a/configshell/log.py b/configshell/log.py index fefd6bd..f76a64f 100644 --- a/configshell/log.py +++ b/configshell/log.py @@ -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): '''