Skip to content

feat: make log level configurable#26

Open
westbrook-ai wants to merge 2 commits into
open-webui:mainfrom
westbrook-ai:feat-log-levels
Open

feat: make log level configurable#26
westbrook-ai wants to merge 2 commits into
open-webui:mainfrom
westbrook-ai:feat-log-levels

Conversation

@westbrook-ai
Copy link
Copy Markdown
Contributor

@westbrook-ai westbrook-ai commented May 24, 2026

What

Adds a TERMINALS_LOG_LEVEL environment variable to control logging verbosity. Closes #21.

The loguru sink was previously hard-coded to DEBUG, which is noisy in production and offered no way to adjust verbosity. This makes the level configurable, defaulting to INFO.

Changes

  • terminals/config.py — new log_level setting (TERMINALS_LOG_LEVEL, default INFO).
  • terminals/logging.py — the loguru sink now uses the configured level. Invalid values fall back to INFO with a warning. The level=0 stdlib intercept is retained intentionally so loguru remains the single arbiter of what gets emitted (uvicorn/sqlalchemy logs included).
  • operator/handler.py — the operator reads the same env var and sets the root stdlib + kopf posting level accordingly. Loguru-only levels (TRACE, SUCCESS) map to their nearest stdlib equivalents.
  • README.md — documents the new variable.

Accepted values: TRACE, DEBUG, INFO, SUCCESS, WARNING, ERROR, CRITICAL.

Testing

Verified manually that the sink honors the configured level (e.g. WARNING suppresses DEBUG/INFO), and that an invalid value (e.g. bogus) falls back to INFO with a warning. No automated test suite is present in the repo.

The service previously hard-coded the loguru sink at DEBUG, producing
noisy output in production with no way to dial it down. Add a
TERMINALS_LOG_LEVEL setting (default INFO) that controls the loguru
sink level in the API service and the stdlib/kopf log level in the
operator. Invalid values fall back to INFO with a warning.

Closes open-webui#21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: make log level configurable

1 participant