From 58f997b6e4877c743b5aa2ea166dc25f953fe582 Mon Sep 17 00:00:00 2001 From: dwest77 Date: Wed, 20 Nov 2024 14:59:32 +0000 Subject: [PATCH] Updated logging mechanism --- facet_scanner/collection_handlers/utils/facet_factory.py | 7 +++++++ facet_scanner/collection_handlers/utils/moles_datasets.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/facet_scanner/collection_handlers/utils/facet_factory.py b/facet_scanner/collection_handlers/utils/facet_factory.py index 7e88f2b..52f9568 100644 --- a/facet_scanner/collection_handlers/utils/facet_factory.py +++ b/facet_scanner/collection_handlers/utils/facet_factory.py @@ -12,7 +12,13 @@ import os from typing import Optional, Tuple from facet_scanner.collection_handlers.base import CollectionHandler +import logging +from facet_scanner import logstream + +logger = logging.getLogger(__name__) +logger.addHandler(logstream) +logger.propagate = False class FacetFactory: """ @@ -56,6 +62,7 @@ def get_handler(self, path: str) -> Tuple[Optional[CollectionHandler], Optional[ :rtype: CollectionHandler, str """ + logger.debug('Locating collection details') collection_details, collection_path = self.get_collection_map(path) if collection_details is not None: return locate(collection_details['handler']), collection_path diff --git a/facet_scanner/collection_handlers/utils/moles_datasets.py b/facet_scanner/collection_handlers/utils/moles_datasets.py index d8f040c..60fb8e6 100644 --- a/facet_scanner/collection_handlers/utils/moles_datasets.py +++ b/facet_scanner/collection_handlers/utils/moles_datasets.py @@ -12,6 +12,13 @@ from json.decoder import JSONDecodeError from requests.exceptions import Timeout import json +import logging + +from facet_scanner import logstream + +logger = logging.getLogger(__name__) +logger.addHandler(logstream) +logger.propagate = False MOLES_MAPPING_FILE = os.environ.get('MOLES_MAPPING_FILE')