Skip to content

Fix maximum level string lookup - #162

Merged
an-dr merged 1 commit into
an-dr:mainfrom
94xhn:fix/level-string-max-boundary
Aug 15, 2026
Merged

Fix maximum level string lookup#162
an-dr merged 1 commit into
an-dr:mainfrom
94xhn:fix/level-string-max-boundary

Conversation

@94xhn

@94xhn 94xhn commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Treat max_level as an inclusive boundary in ulog_level_to_string().
  • Add a regression test for the default FATAL level.

Problem

Level descriptors and level_is_valid() both treat max_level as the final valid entry. The string conversion used a greater-than-or-equal check, so the configured maximum returned ? instead of its name. This affected the default FATAL level and the maximum entry of custom descriptors such as syslog EMERG.

Validation

  • MinGW CMake build and full CTest suite: 16/16 passed
  • CoreTests with -Wall -Wextra -Werror
  • Baseline/fixed checks for the default and syslog maximum levels

Level descriptors define max_level as an inclusive boundary, but the string conversion rejected that final valid entry. Align the check with the existing validity rules and cover the default FATAL boundary.

Constraint: Custom level descriptors also rely on an inclusive max_level

Confidence: high

Scope-risk: narrow

Directive: Keep level string validation aligned with level_is_valid

Tested: MinGW full CTest 16/16; strict -Wall -Wextra -Werror CoreTests; default and syslog boundary matrix

Not-tested: Linux full suite because local WSL p9 access stalled
@an-dr
an-dr merged commit 8dd4062 into an-dr:main Aug 15, 2026
2 of 3 checks passed
@an-dr

an-dr commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Nice! Thanks for the contribution ❤️

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