Worker and web logging with configurable level and file #13
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Reference
marvin8/xique!13
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/issue-11-worker-logging"
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?
Both processes were completely silent: no logging anywhere in the codebase, job failures recorded only in the
jobstable, and an operator runningxique-workerhad no way to see a missingXIQUE_TMDB_TOKENor any other failure without querying the database.Closes #11
What this does
XIQUE_LOG_LEVEL(defaultINFO, case-insensitive stdlib level names) andXIQUE_LOG_FILE(default unset) join theXIQUE_*settings family.xique.logsetup.configure_logging: errors and above on stdout; withXIQUE_LOG_FILEset, a rotating file handler (5 MB, 3 backups) at the configured level down toDEBUG. Handlers are marked and replaced on reconfiguration, so repeated calls never stack output. The root logger sits at the least severe installed sink level.jobs-table messages (new_fail_loggedhelper); unexpected handler exceptions at ERROR with full traceback vialogger.exception. Jellyfin sync result counts at DEBUG. Idle cycles stay quiet at INFO.xique-webconfigures logging before uvicorn starts.Notes for review
TraktImportError, TMDB errors) log at ERROR with the same token-free message stored injobs.error..gitignorenow excludes the local runtime database files (xique.db*) that were untracked clutter in the worktree.Testing
tests/test_logsetup.py(11 tests, written RED first): settings validation and defaults, handler levels and sink routing, idempotent reconfiguration, DEBUG-to-file delivery, worker failure/traceback/lifecycle records, and both entry points callingconfigure_loggingbefore any work.uv run noxgreen at commit147729eexcept the zaojun/pre-commit sessions, which fail onmaintoo due to upstream releases (fastapi 0.143.1, pydantic 2.14.1, pydantic-settings 2.16.0). #12 bumps those pins; after it merges I will rebase this branch so CI runs clean.147729e0245e82f6ef12