Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/helpermodules/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ def mb_to_bytes(megabytes: int) -> int:
logging.getLogger("uModbus").setLevel(logging.WARNING)
logging.getLogger("websockets").setLevel(logging.WARNING)

thread_errors_path = Path(Path(__file__).resolve().parents[2]/"ramdisk"/"thread_errors.log")
with thread_errors_path.open("w") as f:
f.write("")

def threading_excepthook(args):
with open(RAMDISK_PATH+"thread_errors.log", "a") as f:
f.write("Uncaught exception in thread:\n")
Expand Down
4 changes: 3 additions & 1 deletion packages/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ def handler5Min(self):
def handler_midnight(self):
try:
save_log(LogType.MONTHLY)
Path(Path(__file__).resolve().parents[1]/"ramdisk"/"thread_errors.log").unlink(missing_ok=True)
thread_errors_path = Path(Path(__file__).resolve().parents[1]/"ramdisk"/"thread_errors.log")
with thread_errors_path.open("w") as f:
f.write("")
except KeyboardInterrupt:
log.critical("Ausführung durch exit_after gestoppt: "+traceback.format_exc())
except Exception:
Expand Down