AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
add utf-8 encoding to file handlers for logging
k-boikov4f33e1bf89e5
diff --git a/autogpt/logs.py b/autogpt/logs.pyindex f18e21402c..c1e436db97 100644--- a/autogpt/logs.py+++ b/autogpt/logs.py@@ -46,7 +46,9 @@ class Logger(metaclass=Singleton):self.console_handler.setFormatter(console_formatter)# Info handler in activity.log- self.file_handler = logging.FileHandler(os.path.join(log_dir, log_file))+ self.file_handler = logging.FileHandler(+ os.path.join(log_dir, log_file), 'a', 'utf-8'+ )self.file_handler.setLevel(logging.DEBUG)info_formatter = AutoGptFormatter("%(asctime)s %(levelname)s %(title)s %(message_no_color)s"@@ -54,7 +56,9 @@ class Logger(metaclass=Singleton):self.file_handler.setFormatter(info_formatter)# Error handler error.log- error_handler = logging.FileHandler(os.path.join(log_dir, error_file))+ error_handler = logging.FileHandler(+ os.path.join(log_dir, error_file), 'a', 'utf-8'+ )error_handler.setLevel(logging.ERROR)error_formatter = AutoGptFormatter("%(asctime)s %(levelname)s %(module)s:%(funcName)s:%(lineno)d %(title)s"