Skip to content

Replace debug toggle with log level dropdown (#252)#332

Merged
nitrobass24 merged 2 commits intodevelopfrom
feat/log-level-dropdown
Apr 4, 2026
Merged

Replace debug toggle with log level dropdown (#252)#332
nitrobass24 merged 2 commits intodevelopfrom
feat/log-level-dropdown

Conversation

@nitrobass24
Copy link
Copy Markdown
Owner

@nitrobass24 nitrobass24 commented Apr 3, 2026

Summary

  • Remove Config.General.debug (bool), add Config.General.log_level (DEBUG/INFO/WARNING/ERROR/CRITICAL, default INFO)
  • UI: replace "Enable Debug" checkbox with "Log Level" dropdown in Logging section
  • --debug CLI flag still works (overrides to DEBUG)
  • Old configs with debug key silently ignored on upgrade — no crash
  • 10 test files updated (unit, integration, E2E)

Test plan

  • All Angular Vitest tests pass
  • Python unit and integration tests pass
  • Verify dropdown renders with all 5 log levels in Settings → Logging
  • Verify --debug CLI flag still forces DEBUG level
  • Upgrade test: start with old config containing debug = True, verify no crash and log_level defaults to INFO

Closes #252

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Replaced binary debug mode with a configurable log level (DEBUG, INFO, WARNING, ERROR, CRITICAL). Default is INFO.
    • Settings UI now exposes a Log Level dropdown; config file supports log_level.
  • Refactor

    • Core logging now uses standard log levels throughout the application and services.
  • Tests

    • Unit, integration and end-to-end tests updated to use log_level (and updated defaults/expectations).

- Remove `Config.General.debug` (bool), add `Config.General.log_level`
  (string: DEBUG, INFO, WARNING, ERROR, CRITICAL, default INFO)
- UI: replace "Enable Debug" checkbox with "Log Level" dropdown
- `--debug` CLI flag still works (overrides to DEBUG)
- Old configs with `debug` key silently ignored on upgrade
- Update 10 test files (unit, integration, E2E)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 97ab0adc-1fa1-4941-a6af-6d9677e3913c

📥 Commits

Reviewing files that changed from the base of the PR and between f6b604a and e53e1d3.

📒 Files selected for processing (1)
  • src/python/tests/unittests/test_common/test_config.py

📝 Walkthrough

Walkthrough

Replaces the boolean debug config with a string log_level (DEBUG/INFO/WARNING/ERROR/CRITICAL). Changes span config models, validation, logger creation and CLI handling, Angular UI (dropdown), and updated tests. Default log level is INFO.

Changes

Cohort / File(s) Summary
Config Models
src/angular/src/app/models/config.ts, src/python/common/config.py
Removed `debug: boolean
UI Settings
src/angular/src/app/pages/settings/options-list.ts
Replaced "Enable Debug" checkbox with a "Log Level" Select bound to ['general','log_level'] and choices DEBUG/INFO/WARNING/ERROR/CRITICAL. Updated dependent descriptions to reference log_level === "DEBUG".
Angular Tests & Fixtures
src/angular/src/app/services/settings/config.service.spec.ts, src/e2e-playwright/tests/settings.spec.ts
Updated test fixtures and e2e assertions to use log_level values; e2e test now targets "Verbose LFTP Logging" state and verifies config.general.verbose.
Logging Infrastructure (Python)
src/python/seedsync.py
Changed Seedsync logger creation signature to accept log_level: str (was debug: bool), derive effective level from --debug or config, set logger levels via getattr(logging, log_level.upper(), logging.INFO).
Python Tests
src/python/tests/... (integration and unit tests listed in summary)
Updated tests to use log_level strings; added unit test test_log_level_allowed; added test ensuring legacy debug key is ignored and log_level defaults to INFO.
Serialization / Handlers
src/python/tests/unittests/test_web/test_serialize/test_serialize_config.py, src/python/tests/integration/test_web/test_handler/test_config.py
Updated serialization and handler tests to expect general.log_level instead of general.debug, adjusted invalid-value tests to validate new error messages.

Sequence Diagram(s)

sequenceDiagram
  participant UI as Client UI
  participant API as Server API
  participant CFG as Config Store
  participant CLI as seedsync (CLI)
  participant LOG as Logger system

  UI->>API: PUT /server/config/set (general.log_level = "DEBUG")
  API->>CFG: persist config.general.log_level="DEBUG"
  API-->>UI: 200 OK
  CLI->>CFG: read config.general.log_level (on start)
  CLI->>CLI: apply CLI --debug override? -> effective_log_level
  CLI->>LOG: _create_logger(log_level=effective_log_level)
  LOG-->>CLI: logger initialized at effective_log_level
  CLI->>API: serve web endpoints (uses same logger)
  API->>LOG: web-access logs emitted at effective_log_level
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I swapped my debug hat for five bright hues,

DEBUG to CRITICAL, a colorful muse.
Logs hop in order, no noisy surprise,
INFO keeps the meadow, DEBUG scouts the skies.
Cheers from the burrow—now pick what you choose!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Replace debug toggle with log level dropdown' directly and concisely describes the main change across the entire changeset.
Linked Issues check ✅ Passed All coding requirements from #252 are met: debug property removed and log_level added with proper defaults, config parser handles old debug entries, UI dropdown implemented, --debug flag preserved, logger updated to use log_level, and tests comprehensively updated.
Out of Scope Changes check ✅ Passed All changes are directly related to replacing the debug toggle with log level configuration across config models, UI, backend logger, and tests; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/log-level-dropdown

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nitrobass24 nitrobass24 merged commit 7640643 into develop Apr 4, 2026
16 checks passed
@nitrobass24 nitrobass24 deleted the feat/log-level-dropdown branch April 4, 2026 23:12
@nitrobass24 nitrobass24 mentioned this pull request Apr 8, 2026
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.

Configurable log verbosity — replace debug toggle with log level dropdown

1 participant