From fcb38bd24b10c08a77ea6f1ead9167a0db571487 Mon Sep 17 00:00:00 2001 From: Nathan Hartland Date: Mon, 13 Jul 2020 17:14:06 +0200 Subject: [PATCH] Adjustments to logging --- dashengine/bigquery.py | 5 ++--- dashengine/pageloader.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dashengine/bigquery.py b/dashengine/bigquery.py index 66eba78..17a0ba8 100644 --- a/dashengine/bigquery.py +++ b/dashengine/bigquery.py @@ -1,7 +1,6 @@ import os import uuid import json -import logging import datetime import google.auth import pandas as pd @@ -84,7 +83,6 @@ def _load_query(query_id: str) -> BigQuery: Returns: (BigQuery): The query and query metadata. """ - logger = logging.getLogger(__name__) target_queryfile = os.path.join(QUERY_DATA_DIRECTORY, query_id + ".yml") with open(target_queryfile, "r") as infile: @@ -102,7 +100,8 @@ def _load_query(query_id: str) -> BigQuery: # TODO figure out better error handling scheme except yaml.YAMLError as exc: - logger.error(exc) + import logging + logging.error(exc) raise exc diff --git a/dashengine/pageloader.py b/dashengine/pageloader.py index 698521e..cbd2213 100644 --- a/dashengine/pageloader.py +++ b/dashengine/pageloader.py @@ -4,12 +4,12 @@ # System import pkgutil import importlib -import logging def page_loader(roots: list) -> dict: """ Reads page modules from subdirectories specified in the `roots` list, and returns them in a dictionary keyed by module.ROUTE. """ + import logging page_dict = {} for root in roots: for importer, package_name, _ in pkgutil.iter_modules([root]):