Fix outputs added via ulog_output_add ignoting build config#158
Open
an-dr wants to merge 5 commits into
Open
Conversation
9e0cbac to
dbc70e5
Compare
…ode (issue #157, saphieron) The old check `#ifndef ULOG_BUILD_DYNAMIC_CONFIG` treated any definition of the macro — including `#define ULOG_BUILD_DYNAMIC_CONFIG 0` — as "activate dynamic mode." When a user placed that line in their ulog_config.h the dynamic-config block forced every ULOG_HAS_* to 1, silently ignoring their ULOG_BUILD_SOURCE_LOCATION=0 and ULOG_BUILD_LEVEL_SHORT=1 settings. Fix: change to `#if !defined(ULOG_BUILD_DYNAMIC_CONFIG) || !(ULOG_BUILD_DYNAMIC_CONFIG)` so that zero-valued definitions keep static mode active. Also adds the ULOG_DYNCONFIG_INIT_* helper macros and ULOG_BUILD_DYNAMIC_* override flags for users who genuinely run dynamic mode and want to control the initial runtime state without calling the ulog_*_config() API at startup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eplr) ulog_event_to_cstr() was passing color=false unconditionally to log_print_event(), so ANSI escape codes never reached custom handlers even after calling ulog_color_config(true) — or when ULOG_BUILD_COLOR=1 in static mode. Fix: pass color_config_is_enabled() instead. In dynamic mode this reads the runtime colour flag; in static mode it expands to the compile-time ULOG_HAS_COLOR constant, so both paths are now consistent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add ulog_event_to_cstr_colored() for handlers that always want ANSI output - Refactor color gating: color_print_start/end are now unconditional; output_stdout_handler checks color_config_is_enabled() at call site - Move event_to_cstr_impl to private section as a shared helper - Extend DynamicConfigTest with ulog_event_to_cstr_colored coverage - Replace issue-named test files with test_event_to_cstr + ulog_config_color_level.h - Bump version 7.0.3 → 7.1.0 (new public API)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.