mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-03 19:57:35 +00:00
fix: log level
# What does this PR do? - categories like "core::server" is not recognized so it's level is not set by 'all=debug' - removed spammy telemetry debug logging ## Test Plan test server launched with LLAMA_STACK_LOGGING='all=debug'
This commit is contained in:
parent
4819a2e0ee
commit
f675b09b69
1 changed files with 10 additions and 1 deletions
|
@ -247,7 +247,16 @@ def get_logger(
|
|||
_category_levels.update(parse_yaml_config(config))
|
||||
|
||||
logger = logging.getLogger(name)
|
||||
logger.setLevel(_category_levels.get(category, DEFAULT_LOG_LEVEL))
|
||||
if category in _category_levels:
|
||||
log_level = _category_levels[category]
|
||||
else:
|
||||
root_category = category.split("::")[0]
|
||||
if root_category in _category_levels:
|
||||
log_level = _category_levels[root_category]
|
||||
else:
|
||||
log_level = _category_levels.get("root", DEFAULT_LOG_LEVEL)
|
||||
logging.warning(f"Unknown logging category: {category}. Falling back to default 'root' level: {log_level}")
|
||||
logger.setLevel(log_level)
|
||||
return logging.LoggerAdapter(logger, {"category": category})
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue