Skip to content

Commit

Permalink
Fix missing logger -> log replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
sd109 committed Nov 3, 2024
1 parent 3294e3e commit 9f75b66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ __pycache__/
**/*.secret
.DS_Store
.tox/
**/.ruff_cache

# Ignore local dev helpers
test-values.y[a]ml
Expand Down
7 changes: 4 additions & 3 deletions web-apps/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def get_logger():
structlog.configure(wrapper_class=structlog.make_filtering_bound_logger(log_level))
return structlog.get_logger()

log = get_logger()

class LLMParams(BaseModel):
"""
Expand All @@ -49,7 +50,7 @@ def get_k8s_namespace():
try:
current_k8s_namespace = open(NAMESPACE_FILE_PATH).read()
return current_k8s_namespace
except FileNotFoundError as err:
except FileNotFoundError:
return None


Expand All @@ -58,7 +59,7 @@ def api_address_in_cluster():
if k8s_ns:
return f"http://llm-backend.{k8s_ns}.svc"
else:
logger.warning(
log.warning(
"Failed to determine k8s namespace from %s - assuming non-kubernetes environment.",
NAMESPACE_FILE_PATH,
)
Expand Down Expand Up @@ -89,7 +90,7 @@ def load_settings() -> dict:
# Sanity checks on settings
unused_overrides = [k for k in overrides.keys() if k not in defaults.keys()]
if unused_overrides:
logger.warning(
log.warning(
f"Overrides {unused_overrides} not part of default settings so may be ignored."
"Please check for typos"
)
Expand Down

0 comments on commit 9f75b66

Please sign in to comment.