Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[log] add Android log system support #2614

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

zhanglongxia
Copy link
Contributor

@zhanglongxia zhanglongxia commented Nov 20, 2024

Developers can use the command ot-ctl log level 5 to change the default log level to DEBUG. Sometimes, the ot-daemon crashes before developers can run the ot-ctl command on Android.

This commit adds the Android log system support, so that developers can run the command setprop log.tag.ot-daemon DEBUG to change the log level before the ot-daemon runs. The log output format is the same with using the Linux log system.

src/common/logging.cpp Show resolved Hide resolved
src/common/logging.cpp Outdated Show resolved Hide resolved
src/common/logging.cpp Show resolved Hide resolved
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.92%. Comparing base (2b41187) to head (e4765e5).
Report is 885 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2614      +/-   ##
==========================================
- Coverage   55.77%   45.92%   -9.86%     
==========================================
  Files          87      106      +19     
  Lines        6890    12624    +5734     
  Branches        0      915     +915     
==========================================
+ Hits         3843     5797    +1954     
- Misses       3047     6511    +3464     
- Partials        0      316     +316     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@superwhd superwhd left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Member

@wgtdkp wgtdkp left a comment

Choose a reason for hiding this comment

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

Thanks!

src/common/logging.cpp Show resolved Hide resolved
@wgtdkp
Copy link
Member

wgtdkp commented Nov 25, 2024

Developers can use the command ot-ctl log level 5 to change the default log level to DEBUG. Sometimes, the ot-daemon crashes before developers can run the ot-ctl command on Android.

This commit adds the Android log system support, so that developers can run the command setprop log.tag.ot-daemon DEBUG to change the log level before the ot-daemon runs.

Will ot-ctl log level 5 continue working on Android?

@zhanglongxia
Copy link
Contributor Author

Will ot-ctl log level 5 continue working on Android?

The final minimum output log level is determined by the highest value of OT log level and Android log level. For example, if the Android log level is set to DEBUG, the ot-ctl log level 5 works. If the Android log level is set to INFO, the ot-ctl log level 5 doesn't work.

Developers can use the command `ot-ctl log level 5` to change the
default log level to DEBUG. Sometimes, the `ot-daemon` crashes before
developers can run the ot-ctl command on Android.

This commit add Android log system support, so that developers can
run the command `setprop log.tag.ot-daemon DEBUG` to change the log
level before the ot-daemon runs.
@jwhui jwhui merged commit 094f9c1 into openthread:main Nov 26, 2024
32 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