From 12643706b12c7f9d4aa8a1ec1905b0f7099217ea Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 14 Jul 2022 10:42:58 -0400 Subject: [PATCH] Island: Treat data_dir like a path in setup_logging() --- monkey/monkey_island/cc/server_utils/island_logger.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/server_utils/island_logger.py b/monkey/monkey_island/cc/server_utils/island_logger.py index bc94bb710..afdc68ae8 100644 --- a/monkey/monkey_island/cc/server_utils/island_logger.py +++ b/monkey/monkey_island/cc/server_utils/island_logger.py @@ -1,6 +1,5 @@ import logging import logging.handlers -import os import sys ISLAND_LOG_FILENAME = "monkey_island.log" @@ -10,10 +9,10 @@ FILE_BACKUP_COUNT = 20 FILE_ENCODING = "utf8" -def setup_logging(data_dir_path, log_level): +def setup_logging(data_dir, log_level): """ Setup the logging configuration - :param data_dir_path: data directory file path + :param data_dir: data directory file path :param log_level: level to log from :return: """ @@ -22,7 +21,7 @@ def setup_logging(data_dir_path, log_level): formatter = _get_log_formatter() - log_file_path = os.path.join(data_dir_path, ISLAND_LOG_FILENAME) + log_file_path = data_dir / ISLAND_LOG_FILENAME _add_file_handler(logger, formatter, log_file_path) _add_console_handler(logger, formatter)