diff --git a/src/disk.py b/src/disk.py index 60975a3..cfacb98 100644 --- a/src/disk.py +++ b/src/disk.py @@ -4,9 +4,13 @@ import pathlib from util import output_dir_path from ddtrace import tracer -import logging -logger = logging.getLogger(__name__) +from config import CONFIG +from logger import set_up_logging + + +logger = set_up_logging(__name__) +tracer.enabled = CONFIG["DATADOG_TRACE_ENABLED"] CSV_FILENAME = "events.csv" CSV_FIELDS = [ diff --git a/src/event.py b/src/event.py index d0a436d..978fce7 100644 --- a/src/event.py +++ b/src/event.py @@ -2,16 +2,19 @@ from datetime import date, datetime from typing import Tuple import pandas as pd -import logging from ddtrace import tracer import warnings +from config import CONFIG from constants import BUS_STOPS, ROUTES_CR, ROUTES_RAPID -import gtfs import disk +import gtfs +from logger import set_up_logging import util -logger = logging.getLogger(__name__) +logger = set_up_logging(__name__) +tracer.enabled = CONFIG["DATADOG_TRACE_ENABLED"] + EVENT_TYPE_MAP = { # use the first instance of this signal as departure diff --git a/src/gtfs.py b/src/gtfs.py index 8caa3cf..caa2f73 100644 --- a/src/gtfs.py +++ b/src/gtfs.py @@ -6,9 +6,14 @@ from urllib.parse import urljoin from ddtrace import tracer from typing import List, Tuple -import logging -logger = logging.getLogger(__name__) +from config import CONFIG +from logger import set_up_logging + + +logger = set_up_logging(__name__) +tracer.enabled = CONFIG["DATADOG_TRACE_ENABLED"] + MAIN_DIR = pathlib.Path("./data/gtfs_archives/") MAIN_DIR.mkdir(parents=True, exist_ok=True)