zephyr
zephyr copied to clipboard
Bluetooth: Host: Add various info/err logging
Make use of BT_INFO
and BT_WARN
to log big events related to connections.
@jhedberg
BT_INFO() should be used only in very rare cases, since it can’t be turned off if you have debug logs enabled.
I assume you are saying that BT_INFO cannot be disabled while enabling logging from other modules. If that's true, then I think we have problem with the logging system.
I really want a log level that prints high-level info that correspond to real-world events, without spewing out bazillions of pages about what the implementation does internally. Maybe there should be a TRACE level that is the most verbose one and DEBUG could be for high-level events. But I think INFO is underused. RFC @jori-nordic ?
The reason I added these in the first place is that I gathered pretty much every sample and Babelsim test prints out these events. So it's clearly not just me who thinks this information is useful.
@jhedberg
BT_INFO() should be used only in very rare cases, since it can’t be turned off if you have debug logs enabled.
I assume you are saying that BT_INFO cannot be disabled while enabling logging from other modules. If that's true, then I think we have problem with the logging system.
I really want a log level that prints high-level info that correspond to real-world events, without spewing out bazillions of pages about what the implementation does internally. Maybe there should be a TRACE level that is the most verbose one and DEBUG could be for high-level events. But I think INFO is underused. RFC @jori-nordic ?
The reason I added these in the first place is that I gathered pretty much every sample and Babelsim test prints out these events. So it's clearly not just me who thinks this information is useful.
I think he means if you enable BT_DEBUG_LOG
, you pretty much don't have control of the logging severity anymore, the INFO level is enabled unconditionally for every bluetooth module. the only thing you have control over is enabling the DBG level, e.g. with BT_DEBUG_SMP
.
I think that sucks too (given that changing the logging severity works just fine at runtime, tested with the shell), and would like to see BT_xx
logging functions deprecated.
@jori-nordic yes, that’s what I mean. And I’m all in favor of moving to standard logging macros instead of Bluetooth specific ones, if someone wants to pick up that task.
I'll move this PR into draft mode then. I think it will be more relevant after we address the move to standard logging macros.
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.
@alwa-nordic any plans to continue with this?
@alwa-nordic any plans to continue with this?
Have we made progress on disabling info level by default?