Skip to content

Commit 30ce2c7

Browse files
authored
Merge pull request #1165 from major/mhayden/logging-consistency-followup
RSPEED-2444: Replace remaining raw logging imports with get_logger()
2 parents 227e504 + 4a72847 commit 30ce2c7

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/app/database.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Database engine management."""
22

3-
import logging
3+
from logging import DEBUG
44
from pathlib import Path
55
from typing import Any, Optional
66

@@ -175,7 +175,7 @@ def initialize_database() -> None:
175175
global engine, session_local # pylint: disable=global-statement
176176

177177
# Debug print all SQL statements if our logger is at-least DEBUG level
178-
echo = bool(logger.isEnabledFor(logging.DEBUG))
178+
echo = bool(logger.isEnabledFor(DEBUG))
179179

180180
create_engine_kwargs = {
181181
"echo": echo,

src/runners/uvicorn.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Uvicorn runner."""
22

3-
import logging
3+
from logging import INFO
4+
45
import uvicorn
56

67
from log import get_logger
@@ -21,7 +22,7 @@ def start_uvicorn(configuration: ServiceConfiguration) -> None:
2122
"""
2223
logger.info("Starting Uvicorn")
2324

24-
log_level = logging.INFO
25+
log_level = INFO
2526

2627
# please note:
2728
# TLS fields can be None, which means we will pass those values as None to uvicorn.run

src/telemetry/configuration_snapshot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"""
1111

1212
import asyncio
13-
import logging
1413
from dataclasses import dataclass
1514
from enum import Enum
1615
from pathlib import PurePath
@@ -19,9 +18,10 @@
1918
import yaml
2019
from pydantic import SecretStr
2120

21+
from log import get_logger
2222
from models.config import Configuration
2323

24-
logger = logging.getLogger(__name__)
24+
logger = get_logger(__name__)
2525

2626
# Masking output constants
2727
CONFIGURED: Literal["configured"] = "configured"

src/utils/vector_search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
and processing RAG chunks that is shared between query_v2.py and streaming_query_v2.py.
55
"""
66

7-
import logging
87
import traceback
98
from typing import Any, Optional
109
from urllib.parse import urljoin
@@ -15,11 +14,12 @@
1514

1615
import constants
1716
from configuration import AppConfig
17+
from log import get_logger
1818
from models.requests import QueryRequest
1919
from models.responses import ReferencedDocument
2020
from utils.types import RAGChunk
2121

22-
logger = logging.getLogger(__name__)
22+
logger = get_logger(__name__)
2323

2424

2525
def _is_solr_enabled(configuration: AppConfig) -> bool:

0 commit comments

Comments
 (0)