Skip to content

Add get_log_level API to query current logging level #1345

@krystophny

Description

@krystophny

Summary
Add a small public API to query the current logging level from Fortran: get_log_level(). This complements set_log_level() and is useful for applications/tests to save/restore verbosity and to assert logger state.

Proposed changes

  • Add integer function get_log_level() to module fortplot_logging, returning the current log level.
  • Re-export it from the top-level fortplot module alongside set_log_level and LOG_LEVEL_* constants.
  • Add a focused FPM test that exercises transitions and verifies that get_log_level() matches expectations.

Rationale

  • Symmetric API (setter + getter) improves usability.
  • Enables tests to assert logger state without relying on output capture.
  • Zero behavior change unless API is called; no impact to existing code.

Verification

  • fpm test should pass, including the new test.
  • No output artifacts affected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions