Skip to content

refactor(log): drop FL_*_F aliases entirely (post-#3272/#3273 cleanup) #3284

Closed

Description

@zackees

Why this issue exists

The _F-suffixed logging macros (FL_WARN_F, FL_ERROR_F, FL_PRINT_F, the FL_LOG_<CHANNEL>_F family, and the FL_LOG_<CHANNEL>_ASYNC_MAIN_F family) were introduced very recently in #3190 (merged 2026-06-16) when stream-form callers were being migrated to printf style. Three days later, #3272 / #3273 (merged 2026-06-19) unified the stream- and printf-style entry points so that FL_WARN(...) accepts both forms via macro-level argument-count dispatch. The _F aliases were preserved only as a transitional fig leaf and now exist as one-line passthroughs to their non-_F counterparts.

There is no remaining reason to keep them:

  • They are not "legacy" — they shipped three days before they became redundant.
  • Every _F call site can be converted to the non-_F form via a single sed-style rename; no semantics change.
  • Keeping them doubles the public macro surface (FL_WARN + FL_WARN_F, FL_ERROR + FL_ERROR_F, FL_PRINT + FL_PRINT_F, plus 7 FL_LOG_*_F and 7 FL_LOG_*_ASYNC_MAIN_F) for zero benefit.
  • New contributors picking between FL_WARN and FL_WARN_F get no signal from naming about which to use, and the lint checker in ci/lint_cpp/legacy_log_macro_checker.py would need extra rules to steer them away from _F.

Scope

Source removal (src/fl/log/log.h):

  • Delete #define FL_WARN_F(...) FL_WARN(__VA_ARGS__) and its _F_IF, _F_ONCE, _F_EVERY siblings.
  • Delete #define FL_ERROR_F(...) and FL_ERROR_F_IF(...).
  • Delete #define FL_PRINT_F(...) and FL_PRINT_F_EVERY(...).
  • Delete #define FL_LOG_SPI_F(...), FL_LOG_RMT_F(...), FL_LOG_PARLIO_F(...), FL_LOG_AUDIO_F(...), FL_LOG_INTERRUPT_F(...), FL_LOG_FLEXIO_F(...), FL_LOG_OBJECTFLED_F(...).
  • Delete the corresponding FL_LOG_*_ASYNC_MAIN_F(...) macros.
  • Delete the no-op (FASTLED_LOG_VERBOSITY=0) branches for all of the above.
  • Delete FL_LOG_ASYNC_F(...).

Call-site rewrite:

Old New
FL_WARN_F(fmt, args) FL_WARN(fmt, args)
FL_ERROR_F(fmt, args) FL_ERROR(fmt, args)
FL_PRINT_F(fmt, args) FL_PRINT(fmt, args)
FL_WARN_F_IF(cond, fmt, args) FL_WARN_IF(cond, fmt, args)
FL_WARN_F_ONCE(fmt, args) FL_WARN_ONCE(fmt, args)
FL_WARN_F_EVERY(ms, fmt, args) FL_WARN_EVERY(ms, fmt, args)
FL_ERROR_F_IF(cond, fmt, args) FL_ERROR_IF(cond, fmt, args)
FL_PRINT_F_EVERY(ms, fmt, args) FL_PRINT_EVERY(ms, fmt, args)
FL_LOG_SPI_F(fmt, args) FL_LOG_SPI(fmt, args)
FL_LOG_RMT_F(fmt, args) FL_LOG_RMT(fmt, args)
... (same pattern for PARLIO, AUDIO, INTERRUPT, FLEXIO, OBJECTFLED) ...
FL_LOG_SPI_ASYNC_MAIN_F(fmt, args) FL_LOG_SPI_ASYNC_MAIN(fmt, args)
... (same pattern for the other async channels) ...
FL_LOG_ASYNC_F(logger, fmt, args) FL_LOG_ASYNC(logger, fmt, args)

Scale: grep FL_WARN_F\s*\(\|FL_ERROR_F\s*\(\|FL_PRINT_F\s*\(\|FL_LOG_\w*_F\s*\(\|FL_LOG_\w*_ASYNC_MAIN_F\s*\( across src/ reports ~1,544 occurrences across 197 files. The largest contributors are the RMT5/Parlio drivers; the rewrite is mechanical (one-pass sed/script + spot-check on stream-form preservation).

Lint update (ci/lint_cpp/legacy_log_macro_checker.py): add a check that flags any newly-introduced FL_*_F\( to prevent regressions.

Tests (tests/fl/log/log.hpp): drop the FL_WARN_F alias still compiles / FL_ERROR_F alias still compiles / FL_PRINT_F alias still compiles subcases that #3273 added. The unified entry-point tests already cover both stream- and printf-style.

Risk

Low. Mechanical rename; the unified macros have been on master since #3273 merged so any in-flight branches calling FL_WARN_F will get a compile error pointing them at FL_WARN. No public API change for users who follow the documented entry points (FastLED.warn(...) etc. are unaffected — this issue scopes purely to the FL_*_F internal macros).

Acceptance

Cross-references

Activity

  1. zackees commented on Jun 27, 2026

    @zackees
    MemberAuthor

    Closing as deferred. The cleanup is correctly scoped (delete all FL_*_F aliases + sed-sweep ~1559 call sites to non-_F form), but the substitution is dangerous in a mixed session: the same sed pattern that updates call sites also rewrites the macro #define lines themselves into self-referential expansions (#define FL_WARN(...) FL_WARN(__VA_ARGS__)), producing compile errors that aren't always caught early. Verified empirically this session.

    To re-open as a focused PR, the safe ordering is:

    1. First DELETE the _F #define lines from src/fl/log/log.h (so the sed sweep doesn't see them).
    2. Then run the sed sweep across src/ examples/ tests/ (excluding log.h).
    3. Compile + lint + full test suite.
    4. Update FL_*_F references in ci/lint_cpp/legacy_log_macro_checker.py if any exist.

    Tracked at meta level under #3023 / closed-#3344. Re-open as a dedicated PR when there's a focused session for it.

    (Note: FL_DBG_F is intentionally not in scope of this cleanup -- it's the only _F variant with semantically distinct format-style behavior on Low-memory targets where the non-_F form drops args entirely.)

  2. moved this from Triage to Done in FastLED Trackeron Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions