Skip to content

Commit

Permalink
Remove hard-coded app name from logger commands
Browse files Browse the repository at this point in the history
  • Loading branch information
stvoutsin committed Oct 1, 2024
1 parent 00775c8 commit 1f46c8c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/sia/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
from fastapi.exceptions import HTTPException, RequestValidationError
from fastapi.templating import Jinja2Templates

from .config import config

_TEMPLATES = Jinja2Templates(
directory=str(Path(__file__).resolve().parent / "templates")
)

logger = structlog.get_logger("sia")
logger = structlog.get_logger(config.name)

# Module may be slightly too long, in the future we may want to break it up

Expand Down
6 changes: 4 additions & 2 deletions src/sia/factories/query_engine_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from lsst.daf.butler import Config as ButlerConfig
from lsst.dax.obscore import ExporterConfig

from ..config import Config
from ..config import Config, config
from ..exceptions import FatalFaultError
from ..models.query_engines import QueryEngines
from ..services.base_query_engine import SIABaseQueryEngine
Expand All @@ -20,6 +20,8 @@

__all__ = ["QueryEngineFactory"]

logger = structlog.get_logger(config.name)


class QueryEngineFactory:
"""Factory class for creating query engine instances.
Expand All @@ -39,7 +41,7 @@ class QueryEngineFactory:

def __init__(self, config: Config) -> None:
self.config = config
self.logger = structlog.get_logger("sia")
self.logger = logger
self.engine_creators: dict[
QueryEngines, Callable[..., SIABaseQueryEngine]
] = {
Expand Down
4 changes: 3 additions & 1 deletion src/sia/services/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

import structlog

logger = structlog.get_logger("sia")
from ..config import config

logger = structlog.get_logger(config.name)


def format_timedelta(td: timedelta) -> str:
Expand Down

0 comments on commit 1f46c8c

Please sign in to comment.