Skip to content

Conversation

@krystophny
Copy link
Collaborator

@krystophny krystophny commented Sep 19, 2025

Summary
Expose a small getter for the logger: get_log_level(). This complements set_log_level() and lets callers/tests query and restore verbosity safely. Re-exported from the top-level fortplot module.

Changes

  • Add get_log_level() in fortplot_logging
  • Re-export via fortplot
  • Add focused test test_log_level_getter.f90
  • Validate set_log_level() input: clamp to valid range [SILENT, DEBUG]
  • Add test test_log_level_input_validation.f90 for out-of-range handling

Verification
Commands

  • make test-ci
  • fpm test --target test_log_level_getter
  • fpm test --target test_log_level_input_validation

Key output excerpts

  • CI-fast: CI essential test suite completed successfully
  • Target (getter): Project compiled successfully
  • Target (input validation): Project compiled successfully

Artifacts

  • No plot/text artifacts affected.

Notes

  • API is additive and backward-compatible.
  • Input validation prevents undefined states from invalid integers.

Reviewer self-check (automation)

  • Ran: make test-ci — passed (fast CI set).
  • Focused runs: fpm test --target test_log_level_getter, fpm test --target test_log_level_input_validation — compiled successfully.
  • Non-artifact change: logging API only; no rendering affected.
  • Docs fix: corrected examples to use LOG_LEVEL_DEBUG in doc/mpeg_validation.md.

Evidence

  • make test-ci (summary): CI essential test suite completed successfully
  • New tests included in build; both compile and run in standard suite.

No further changes required for production readiness.

\nDocs\n- Added usage example for get_log_level() and safe restore pattern in doc/warning_system.md.\n

Follow-up fixes

  • Make FORTPLOT_FORCE_WARNINGS override all suppression (takes highest precedence).
  • Update doc/warning_system.md with clarified precedence and a getter/restore snippet.

…d add test

- Clamp input to [SILENT, DEBUG] to avoid undefined states
- Add test_log_level_input_validation covering out-of-range handling

No output/rendering changes; CI-fast tests pass.
@krystophny krystophny merged commit cb1c89d into main Sep 19, 2025
2 checks passed
@krystophny krystophny deleted the fix/issue-1345-add-get-log-level branch September 19, 2025 16:16
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.

2 participants