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:
Eric Huang 2025-10-01 09:28:58 -07:00
parent 4819a2e0ee
commit 168b42cd99
2 changed files with 10 additions and 4 deletions

View file

@ -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})

View file

@ -317,7 +317,6 @@ class SpanContextManager:
global CURRENT_TRACE_CONTEXT
context = CURRENT_TRACE_CONTEXT.get()
if not context:
logger.debug("No trace context to pop span")
return
context.pop_span()
@ -332,7 +331,6 @@ class SpanContextManager:
global CURRENT_TRACE_CONTEXT
context = CURRENT_TRACE_CONTEXT.get()
if not context:
logger.debug("No trace context to push span")
return self
self.span = context.push_span(self.name, self.attributes)
@ -342,7 +340,6 @@ class SpanContextManager:
global CURRENT_TRACE_CONTEXT
context = CURRENT_TRACE_CONTEXT.get()
if not context:
logger.debug("No trace context to pop span")
return
context.pop_span()