Skip to content

[border-router] introduce br_log for logging helpers - #11998

Merged
jwhui merged 1 commit into
openthread:mainfrom
abtink:br/move-log-helpers
Oct 7, 2025
Merged

[border-router] introduce br_log for logging helpers#11998
jwhui merged 1 commit into
openthread:mainfrom
abtink:br/move-log-helpers

Conversation

@abtink

@abtink abtink commented Oct 6, 2025

Copy link
Copy Markdown
Member

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.

@github-actions

github-actions Bot commented Oct 6, 2025

Copy link
Copy Markdown

Merging #11998 into main

name branch text data bss total
ot-cli-ftd cfd1d08 479928 860 66580 547368
e5dc905 479928 860 66580 547368
+/- +0 +0 +0 +0
ot-ncp-ftd cfd1d08 446332 764 61824 508920
e5dc905 446332 764 61824 508920
+/- +0 +0 +0 +0
ot-cli-mtd cfd1d08 372560 764 51052 424376
e5dc905 372560 764 51052 424376
+/- +0 +0 +0 +0
ot-ncp-mtd cfd1d08 353612 764 46320 400696
e5dc905 353612 764 46320 400696
+/- +0 +0 +0 +0
ot-cli-ftd-br cfd1d08 582592 868 136404 719864
e5dc905 582608 868 136404 719880
+/- +16 +0 +0 +16
ot-rcp cfd1d08 63136 568 20804 84508
e5dc905 63136 568 20804 84508
+/- +0 +0 +0 +0
Library files
name branch text data bss total
libopenthread-ftd.a cfd1d08 247024 95 40358 287477
e5dc905 247024 95 40358 287477
+/- +0 +0 +0 +0
libopenthread-cli-ftd.a cfd1d08 61027 0 8083 69110
e5dc905 61027 0 8083 69110
+/- +0 +0 +0 +0
libopenthread-ncp-ftd.a cfd1d08 33581 0 5948 39529
e5dc905 33581 0 5948 39529
+/- +0 +0 +0 +0
libopenthread-mtd.a cfd1d08 165305 0 24854 190159
e5dc905 165305 0 24854 190159
+/- +0 +0 +0 +0
libopenthread-cli-mtd.a cfd1d08 41251 0 8059 49310
e5dc905 41251 0 8059 49310
+/- +0 +0 +0 +0
libopenthread-ncp-mtd.a cfd1d08 25805 0 5948 31753
e5dc905 25805 0 5948 31753
+/- +0 +0 +0 +0
libopenthread-ftd-br.a cfd1d08 350987 100 110150 461237
e5dc905 351000 100 110150 461250
+/- +13 +0 +0 +13
libopenthread-cli-ftd-br.a cfd1d08 78917 0 8115 87032
e5dc905 78917 0 8115 87032
+/- +0 +0 +0 +0
libopenthread-rcp.a cfd1d08 9944 0 5060 15004
e5dc905 9944 0 5060 15004
+/- +0 +0 +0 +0
libopenthread-radio.a cfd1d08 19411 0 238 19649
e5dc905 19411 0 238 19649
+/- +0 +0 +0 +0

@codecov

codecov Bot commented Oct 6, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.37%. Comparing base (cfd1d08) to head (737c9dd).
⚠️ Report is 1 commits behind head on main.

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     
Files with missing lines Coverage Δ
src/core/border_router/br_log.cpp 100.00% <100.00%> (ø)
src/core/border_router/br_log.hpp 100.00% <100.00%> (ø)
src/core/border_router/routing_manager.cpp 89.33% <ø> (-3.24%) ⬇️
src/core/border_router/routing_manager.hpp 80.32% <ø> (-9.19%) ⬇️

... and 358 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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`.
@abtink
abtink force-pushed the br/move-log-helpers branch from ea28a07 to 737c9dd Compare October 7, 2025 00:10
@abtink

abtink commented Oct 7, 2025

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/core/border_router/br_log.cpp
Comment thread src/core/border_router/br_log.cpp

@Irving-cl Irving-cl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jwhui
jwhui requested a review from Copilot October 7, 2025 03:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RoutingManager to new br_log module
  • Updated log module name from "RoutingManager" to "BorderRouting" for broader scope
  • Added new source files br_log.cpp and br_log.hpp with 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.

@jwhui
jwhui merged commit 0cbac53 into openthread:main Oct 7, 2025
102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants