Skip to content

chore(fl): eliminate detail/ + details/ dirs, introduce fl/log/ - #2442

Merged
zackees merged 2 commits into
masterfrom
chore/eliminate-fl-detail-details
May 10, 2026
Merged

zackees merged 2 commits into
masterfrom
chore/eliminate-fl-detail-details

Conversation

@zackees

@zackees zackees commented May 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Removes the legacy src/fl/detail/ and src/fl/details/ top-level directories that predated the per-domain subfolder aggregation. Convention is firmly detail/ (singular) — matches boost::detail, std::__detail, and the existing fl/stl/detail/, fl/gfx/detail/, fl/channels/detail/ subdirs.

Re-org

Old path New path Reason
src/fl/details/crgb_extra.cpp.hpp src/fl/gfx/crgb_extra.cpp.hpp CRGB↔HSV methods; gfx already owns crgb.h, hsv16.h
src/fl/detail/async_log_queue.{h,cpp.hpp} src/fl/log/async_log_queue.{h,cpp.hpp} New fl/log/ for logging internals (boost/absl/glog convention)
src/fl/detail/async_logger.{h,cpp.hpp} src/fl/log/async_logger.{h,cpp.hpp} Same
src/fl/detail/private.h src/fl/stl/private.h Only consumer is stl/unordered_map.h

Why a new fl/log/?

  • log is the canonical name in idiomatic C++: Boost.Log (boost/log/), Abseil (absl/log/), glog
  • logging/ is rare in C++ (more common in Python/Java); logger/ is rarely used as a directory name
  • Logging implementation internals (queue + logger machinery) get a dedicated home

Public API unchanged

fl/system/log.h (the public log API used by 250+ files) is not moved. It now includes from fl/log/ internally. Zero consumer churn.

Test files

  • tests/fl/detail/*.hpp → tests/fl/log/*.hpp
  • tests/fl/detail.cpp → tests/fl/log.cpp (aggregator at parent level per existing convention)

Build/lint glue updated

  • src/fl/_build.cpp.hpp — added fl/log/_build.cpp.hpp, removed both old detail entries
  • src/fl/build/fl.log+.cpp — new unity-build target
  • src/fl/build/fl.{detail,details}+.cpp — deleted
  • ci/lint_cpp/test_unity_build.py — manifest updated
  • ci/lint_cpp/{test_path_structure_checker,headers_exist_checker}.py — exemption renamed
  • ci/iwyu/fastled.imp — comment paths updated
  • tests/test_config.py — EXCLUDED_TEST_DIRS updated

Test plan

  • bash test --cpp --clean — all 220 unit tests pass (one flaky audio detector test unrelated to changes; passes in --debug mode)
  • bash lint --cpp — clean (TestAggregationChecker happy after tests/fl/log.cpp rename)
  • CI green on PR

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Reorganized internal module architecture and component structure.
  • Tests

    • Updated test organization to align with new module layout.
  • Documentation

    • Added IWYU platform headers integration guide.
  • Chores

    • Updated build system and CI configuration files.

Review Change Stack

zackees and others added 2 commits May 10, 2026 07:42
Relocates `src/fl/cled_controller.h` to `src/fl/channels/cled_controller.h`
so the LED controller base class lives next to the channels/buses that wrap
it (and the `ChannelOptions` it already depends on).

Updates the legacy shim `src/cled_controller.h` and the two direct test
consumers to use the new include path. The shim continues to re-export
`CLEDController` into the global namespace for user-facing code.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Removes the legacy `src/fl/detail/` and `src/fl/details/` directories that
predated the per-domain subfolder aggregation. Convention is now firmly
`detail/` (singular, matching boost::detail / std::__detail and the existing
fl/stl/detail/, fl/gfx/detail/, fl/channels/detail/ subdirs).

Re-org:
  src/fl/details/crgb_extra.cpp.hpp     → src/fl/gfx/crgb_extra.cpp.hpp
  src/fl/detail/async_log_queue.{h,cpp} → src/fl/log/async_log_queue.{h,cpp}
  src/fl/detail/async_logger.{h,cpp}    → src/fl/log/async_logger.{h,cpp}
  src/fl/detail/private.h               → src/fl/stl/private.h

Introduces `src/fl/log/` as the home for logging implementation internals
(name follows boost::log / absl::log / glog convention). The public log
API (`fl/system/log.h`) is unchanged — it now includes from `fl/log/`
internally; no consumer churn for the 250+ files that include it.

Test files mirror the new layout (tests/fl/log/ with tests/fl/log.cpp
aggregator). Build glue, unity build manifest, IWYU mappings, and
linter exemption tables updated to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented May 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0ef79e95-204f-4ce7-bdfe-6ee5c0689fbb

📥 Commits

Reviewing files that changed from the base of the PR and between a2f6190 and 1c6b68f.

📒 Files selected for processing (34)
  • agents/tests.md
  • ci/iwyu/fastled.imp
  • ci/lint_cpp/headers_exist_checker.py
  • ci/lint_cpp/test_path_structure_checker.py
  • ci/lint_cpp/test_unity_build.py
  • docs/iwyu-platform-headers-report.md
  • src/cled_controller.h
  • src/fl/_build.cpp.hpp
  • src/fl/build/fl.detail+.cpp
  • src/fl/build/fl.details+.cpp
  • src/fl/build/fl.log+.cpp
  • src/fl/channels/cled_controller.h
  • src/fl/detail/_build.cpp.hpp
  • src/fl/details/_build.cpp.hpp
  • src/fl/gfx/_build.cpp.hpp
  • src/fl/gfx/crgb_extra.cpp.hpp
  • src/fl/log/_build.cpp.hpp
  • src/fl/log/async_log_queue.cpp.hpp
  • src/fl/log/async_log_queue.h
  • src/fl/log/async_logger.cpp.hpp
  • src/fl/log/async_logger.h
  • src/fl/stl/private.h
  • src/fl/stl/unordered_map.h
  • src/fl/system/log.cpp.hpp
  • src/fl/system/log.h
  • tests/fastled_core.cpp
  • tests/fl/detail.cpp
  • tests/fl/log.cpp
  • tests/fl/log/async_log_queue.hpp
  • tests/fl/log/async_logger.hpp
  • tests/fl/log/async_logger_error_detection.hpp
  • tests/fl/log/async_logger_output.hpp
  • tests/fl/power_estimation.cpp
  • tests/test_config.py

📝 Walkthrough

Walkthrough

This PR reorganizes async logging components from an internal fl/detail/ location into a dedicated public fl/log/ module. It includes updates to unity build composition, system integration points, test infrastructure, and CI/lint configuration. Additionally, crgb_extra migrates from fl/details/ to fl/gfx/, and CLEDController header moves to fl/channels/. Comprehensive IWYU platform headers documentation is added.

Changes

Async Logger Module Reorganization

Layer / File(s) Summary
Public API Relocation
src/fl/log/async_logger.h, src/fl/log/async_log_queue.h, src/fl/channels/cled_controller.h
Async logger and queue headers relocated from fl/detail/ to public fl/log/ module; CLEDController header path updated to fl/channels/. File documentation comments reflect new paths; no signature changes.
Implementation Unit Migration
src/fl/log/async_logger.cpp.hpp, src/fl/log/async_log_queue.cpp.hpp, src/fl/log/_build.cpp.hpp
Implementation translation units moved to fl/log/ and updated to include relocated public headers. New unity build header fl/log/_build.cpp.hpp created to aggregate async logger and queue implementations.
Unity Build Reorganization
src/fl/_build.cpp.hpp, src/fl/build/fl.log+.cpp, src/fl/build/fl.detail+.cpp, src/fl/build/fl.details+.cpp, src/fl/detail/_build.cpp.hpp, src/fl/details/_build.cpp.hpp, src/fl/gfx/_build.cpp.hpp
Main unity header includes fl/log/_build.cpp.hpp instead of detail modules; new fl.log+.cpp source created; fl.detail+.cpp and fl.details+.cpp emptied; async logger includes removed from detail module; crgb_extra moved from details to gfx build.
System Integration
src/fl/system/log.h, src/fl/system/log.cpp.hpp, src/fl/stl/unordered_map.h, src/cled_controller.h
System headers updated to include fl/log/async_logger.h instead of fl/detail/async_logger.h under same compile conditions; unordered_map.h now includes fl/stl/private.h instead of fl/detail/private.h; CLEDController backward-compatibility alias include updated.
Test Infrastructure
tests/fl/log.cpp, tests/fl/detail.cpp, tests/fl/log/*.hpp, tests/fastled_core.cpp, tests/fl/power_estimation.cpp
Test aggregator moved from tests/fl/detail.cpp to tests/fl/log.cpp; individual test headers in tests/fl/log/ updated to include relocated async logger; test files across codebase updated for CLEDController relocation.
CI Configuration & Documentation
ci/lint_cpp/test_unity_build.py, ci/lint_cpp/headers_exist_checker.py, ci/lint_cpp/test_path_structure_checker.py, ci/iwyu/fastled.imp, tests/test_config.py, agents/tests.md, docs/iwyu-platform-headers-report.md
Build file expectations updated to fl.log+.cpp; excluded test files updated from detail.cpp to log.cpp across three linters; test discovery excludes tests/fl/log instead of tests/fl/detail; IWYU comments reference fl/stl/private.h; comprehensive IWYU platform headers report added.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • FastLED/FastLED#2414: Updates EXPECTED_BUILD_FILES in the same CI lint file (ci/lint_cpp/test_unity_build.py), sharing code-level changes to unity build expectations.

Poem

🐰 Log files hop to their new home,
From detail's dark to log's bright zone,
Unity builds dance in tune,
CRGB shimmers beneath the moon,
Tests aggregate, CI feels fine,
A refactored structure so divine! 📜✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/eliminate-fl-detail-details

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees
zackees merged commit 26cf159 into master May 10, 2026
0 of 7 checks passed
zackees added a commit that referenced this pull request May 10, 2026
Completes the logging consolidation begun in PR #2442 (which moved
async_log_queue and async_logger into src/fl/log/). The user-facing
log API now also lives entirely in src/fl/log/, leaving no logging
files in src/fl/system/.

Mechanical changes only — no API behavior changes. FL_LOG, FL_DBG,
FL_WARN, and FL_ERROR macros keep their existing semantics; only the
include path moves from "fl/system/log.h" to "fl/log/log.h" across all
271 consumers.

- Move src/fl/system/log.h -> src/fl/log/log.h
- Move src/fl/system/log.cpp.hpp -> src/fl/log/log.cpp.hpp
- Update unity-build glue (drop log.cpp.hpp from fl/system/_build,
  add to fl/log/_build)
- Bulk-flip 271 #include paths via Python script
- Move tests/fl/system/log.cpp -> tests/fl/log/log.hpp and wire it
  into the existing tests/fl/log.cpp aggregator (alongside trace.hpp)
- Update README and inline comments referencing the old path

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees deleted the chore/eliminate-fl-detail-details branch May 30, 2026 20:01
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.

1 participant