diff --git a/source/logger_sys.py b/source/logger_sys.py index 91b43e6..71a641c 100644 --- a/source/logger_sys.py +++ b/source/logger_sys.py @@ -1,23 +1,9 @@ -import logging import os import appdirs -from datetime import date +from datetime import * def log_message(message): program_dir = str(appdirs.user_config_dir(appname='Bane-Of-Wargs')) - # Create log file - with open(f'{program_dir}/logs/{date.today()}.log', 'w') as f: - f.write("LOG") - - # Create and configure logger - logging.basicConfig(filename=f'{program_dir}/logs/{date.today()}.log', - format='%(asctime)s %(message)s', - filemode='w' - ) - - - # Let us create an object - logger = logging.getLogger() - - logger.warning(message) + with open(f'{program_dir}/logs/{date.today()}.log', 'a') as f: + f.write(f'{datetime.now()}: {message}\n')