fix: remove category prints

commands where the output is important `llama stack build --show-deps` (soon to be `llama stack show`) print some log.py `cprint`'s on _every_ execution of the CLI

These prints aren't necessary as the user is the one setting the logging config, they probably don't need to be alerted that these levels are being set

Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
Charlie Doern 2025-08-18 13:12:55 -04:00
parent f4cecaade9
commit 6bc1b978a6

View file

@ -7,13 +7,11 @@
import logging import logging
import os import os
import re import re
import sys
from logging.config import dictConfig from logging.config import dictConfig
from rich.console import Console from rich.console import Console
from rich.errors import MarkupError from rich.errors import MarkupError
from rich.logging import RichHandler from rich.logging import RichHandler
from termcolor import cprint
from llama_stack.core.datatypes import LoggingConfig from llama_stack.core.datatypes import LoggingConfig
@ -66,7 +64,6 @@ def config_to_category_levels(category: str, level: str):
category_levels["root"] = level_value category_levels["root"] = level_value
elif category in CATEGORIES: elif category in CATEGORIES:
category_levels[category] = level_value category_levels[category] = level_value
logging.info(f"Setting '{category}' category to level '{level}'.")
else: else:
logging.warning(f"Unknown logging category: {category}. No changes made.") logging.warning(f"Unknown logging category: {category}. No changes made.")
return category_levels return category_levels
@ -256,7 +253,6 @@ def get_logger(
env_config = os.environ.get("LLAMA_STACK_LOGGING", "") env_config = os.environ.get("LLAMA_STACK_LOGGING", "")
if env_config: if env_config:
cprint(f"Environment variable LLAMA_STACK_LOGGING found: {env_config}", color="yellow", file=sys.stderr)
_category_levels.update(parse_environment_config(env_config)) _category_levels.update(parse_environment_config(env_config))
log_file = os.environ.get("LLAMA_STACK_LOG_FILE") log_file = os.environ.get("LLAMA_STACK_LOG_FILE")