[border-router] introduce br_log for logging helpers - #11998
Conversation
Library files
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11998 +/- ##
==========================================
+ Coverage 70.59% 76.37% +5.78%
==========================================
Files 659 645 -14
Lines 102307 95417 -6890
==========================================
+ Hits 72222 72876 +654
+ Misses 30085 22541 -7544
🚀 New features to boost your workflow:
|
This change introduces new files `br_log.cpp` and `br_log.hpp` to house common logging helper functions for the border router modules. Helper functions for logging Router Advertisement (RA) headers, Prefix Information Options (PIO), Route Information Options (RIO), and other related options are moved into this new module. The log module name is also updated from `RoutingManager` to a more general `BorderRouting`. This change improves code structure by decoupling logging functionalities from the `RoutingManager`.
ea28a07 to
737c9dd
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a nice refactoring that moves logging helper functions into a new br_log module, improving code organization and decoupling logging from the RoutingManager. The log module name is also appropriately updated to the more general BorderRouting. The changes are well-structured and clear. I have a couple of minor suggestions for the new br_log.cpp file to further improve the code.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new logging module br_log to house common Border Router logging helper functions. The change extracts logging functions from RoutingManager into dedicated files, improving code modularity and organization.
- Moved logging functions for RA headers, PIO, RIO, and RDNSS options from
RoutingManagerto newbr_logmodule - Updated log module name from "RoutingManager" to "BorderRouting" for broader scope
- Added new source files
br_log.cppandbr_log.hppwith proper build system integration
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/core/border_router/routing_manager.hpp | Removed logging function declarations from RoutingManager class |
| src/core/border_router/routing_manager.cpp | Removed logging function implementations and updated log module name |
| src/core/border_router/br_log.hpp | New header file with logging function declarations and documentation |
| src/core/border_router/br_log.cpp | New implementation file with extracted logging functions |
| src/core/CMakeLists.txt | Added br_log.cpp to build configuration |
| src/core/BUILD.gn | Added br_log source files to build configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This change introduces new files
br_log.cppandbr_log.hppto house common logging helper functions for the border router modules.Helper functions for logging Router Advertisement (RA) headers, Prefix Information Options (PIO), Route Information Options (RIO), and other related options are moved into this new module.
The log module name is also updated from
RoutingManagerto a more generalBorderRouting.This change improves code structure by decoupling logging functionalities from the
RoutingManager.