mirror of
https://github.com/Xevion/linkpulse.git
synced 2025-12-07 11:15:35 -06:00
Access environment variables directly in setup_logging
This commit is contained in:
@@ -24,7 +24,10 @@ def drop_color_message_key(_, __, event_dict: EventDict) -> EventDict:
|
|||||||
return event_dict
|
return event_dict
|
||||||
|
|
||||||
|
|
||||||
def setup_logging(json_logs: bool = False, log_level: str = "INFO"):
|
def setup_logging(json_logs: Optional[bool] = None, log_level: Optional[str] = None) -> None:
|
||||||
|
json_logs = json_logs or os.getenv("LOG_JSON_FORMAT", "true").lower() == "true"
|
||||||
|
log_level = log_level or os.getenv("LOG_LEVEL", "INFO")
|
||||||
|
|
||||||
def flatten(n):
|
def flatten(n):
|
||||||
match n:
|
match n:
|
||||||
case []: return []
|
case []: return []
|
||||||
|
|||||||
Reference in New Issue
Block a user