From 55d727792a4e8ca16c52bc782e42ce057a5d4b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Sat, 31 Dec 2022 12:19:42 +0100 Subject: [PATCH] fix: Add logger in capture cache --- lookyloo/capturecache.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lookyloo/capturecache.py b/lookyloo/capturecache.py index 5a013ea0..bd6a7cd1 100644 --- a/lookyloo/capturecache.py +++ b/lookyloo/capturecache.py @@ -31,9 +31,11 @@ from .exceptions import MissingCaptureDirectory, NoValidHarFile, MissingUUID, Tr class CaptureCache(): __slots__ = ('uuid', 'title', 'timestamp', 'url', 'redirects', 'capture_dir', 'error', 'incomplete_redirects', 'no_index', 'categories', 'parent', - 'user_agent', 'referer') + 'user_agent', 'referer', 'logger') def __init__(self, cache_entry: Dict[str, Any]): + self.logger = logging.getLogger(f'{self.__class__.__name__}') + self.logger.setLevel(get_config('generic', 'loglevel')) __default_cache_keys: Tuple[str, str, str, str, str, str] = ('uuid', 'title', 'timestamp', 'url', 'redirects', 'capture_dir') if 'uuid' not in cache_entry or 'capture_dir' not in cache_entry: