MCPcopy Create free account
hub / github.com/Tong89/smartNode / get_log_level

Function get_log_level

backend/config.py:94–105  ·  view source on GitHub ↗

从环境变量 SMARTNODE_LOG_LEVEL 或 LOG_LEVEL 解析日志级别。 SMARTNODE_LOG_LEVEL 优先级高于 LOG_LEVEL(兼容旧约定)。 默认返回 logging.INFO。

()

Source from the content-addressed store, hash-verified

92
93
94def get_log_level() -> int:
95 """从环境变量 SMARTNODE_LOG_LEVEL 或 LOG_LEVEL 解析日志级别。
96
97 SMARTNODE_LOG_LEVEL 优先级高于 LOG_LEVEL(兼容旧约定)。
98 默认返回 logging.INFO。
99 """
100 raw = (
101 os.environ.get("SMARTNODE_LOG_LEVEL")
102 or os.environ.get("LOG_LEVEL")
103 or "INFO"
104 ).upper().strip()
105 return getattr(logging, raw, logging.INFO)
106
107
108class LayeredSettings:

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected