From 7a2ff04978120f5b5165a594887cfd9b08b3bb36 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 1 Aug 2022 13:34:56 +0530 Subject: [PATCH] Island: Remove IslandLogService --- .../monkey_island/cc/services/island_logs.py | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 monkey/monkey_island/cc/services/island_logs.py diff --git a/monkey/monkey_island/cc/services/island_logs.py b/monkey/monkey_island/cc/services/island_logs.py deleted file mode 100644 index 0bbf4ec0b..000000000 --- a/monkey/monkey_island/cc/services/island_logs.py +++ /dev/null @@ -1,30 +0,0 @@ -import logging - -logger = logging.getLogger(__name__) - - -class IslandLogService: - def __init__(self): - pass - - @staticmethod - def get_log_file(): - """ - This static function is a helper function for the monkey island log download function. - It finds the logger handlers and checks if one of them is a fileHandler of any kind by - checking if the handler - has the property handler.baseFilename. - :return: - a dict with the log file content. - """ - logger_handlers = logger.parent.handlers - for handler in logger_handlers: - if hasattr(handler, "baseFilename"): - logger.info("Log file found: {0}".format(handler.baseFilename)) - log_file_path = handler.baseFilename - with open(log_file_path, "rt") as f: - log_file = f.read() - return {"log_file": log_file} - - logger.warning("No log file could be found, check logger config.") - return None