mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #1237] [MERGED] Migrate to python logging module with env var control. #20608
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/1237
Author: @ghost
Created: 3/20/2024
Status: ✅ Merged
Merged: 3/24/2024
Merged by: @tjbck
Base:
dev← Head:debug_print📝 Commits (3)
e6dd0bfMigrate to python logging module with env var control.f74f2eaMerge conflicts371dfc1Merge branch 'dev' into debug_print📊 Changes
15 files changed (+174 additions, -82 deletions)
View changed files
📝
backend/apps/audio/main.py(+8 -4)📝
backend/apps/images/main.py(+7 -3)📝
backend/apps/litellm/main.py(+7 -2)📝
backend/apps/ollama/main.py(+37 -34)📝
backend/apps/openai/main.py(+13 -8)📝
backend/apps/rag/main.py(+12 -9)📝
backend/apps/rag/utils.py(+7 -3)📝
backend/apps/web/internal/db.py(+5 -2)📝
backend/apps/web/models/auths.py(+7 -2)📝
backend/apps/web/models/documents.py(+7 -2)📝
backend/apps/web/models/tags.py(+9 -4)📝
backend/apps/web/routers/chats.py(+7 -2)📝
backend/apps/web/routers/users.py(+6 -1)📝
backend/config.py(+34 -4)📝
backend/main.py(+8 -2)📄 Description
Pull Request Checklist
Description
Introduce Python
loggingand migrate allprint()statements to it. To mirror current functionality, logging doesn't use a file, onlysys.stdout. A global varGLOBAL_LOG_LEVELand any of following likeOLLAMA_LOG_LEVEL=DEBUGcan be set:log_sources = ["AUDIO", "CONFIG", "DB", "IMAGES", "LITELLM", "MAIN", "MODELS", "OLLAMA", "OPENAI", "RAG"]. Note that this is additionally beneficial as it affects any 3rd party imports that use the Python logging module including LITELLM.Changelog Entry
First commit
Added
import loggingfunctionality.Fixed
Changed
print()Removed
print()statements withlog.statements.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.