From 87e0c8577a3ef1303641a8e5ed3c8cfcf28008a7 Mon Sep 17 00:00:00 2001 From: askiiart Date: Thu, 1 Feb 2024 12:34:46 -0600 Subject: [PATCH] make it actually function at all --- logging_template.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/logging_template.py b/logging_template.py index f474da0..0eba45b 100644 --- a/logging_template.py +++ b/logging_template.py @@ -1,7 +1,9 @@ class LoggingTemplate: - # there's no close() and that might cause some issues def __init__(self, arguments): - self.log_file = open(arguments['file'], 'wt') + self.log_filename = arguments['file'] def log(self, service_name, code, status): - self.log_file.write(f'{service_name} {code}: {status}\n') + # there's definitely a better way to do this but i'm not gonna bother + log_file = open(self.log_filename, 'at') + log_file.write(f'{service_name} {code}: {status}\n') + log_file.close()