logging: fixes and enhancements to initialization and shell cmds #84955
+22
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
logging: init backend id regardless of autostart
The
id
is basically a compile-time constant. Setting it everytime the backend is enabled is unnecessary. Instead, set it on
z_log_init()
regardless of whether or not it requires to beautostart
ed.Fixes an issue where the
filter_get
/filter_set
accessed the wrong index and displayed the wrong log level when
user accesses the status of an uninitialized backend via:
log backend <uninitialized_backend> status
.Also fixes an issue when user tries to list the backends via:
log list_backends
, where all uninitialized backends will haveID = 0.
logging: log_cmds: init uninitialized backend on
log_go()
For backends that do not autostart themselves, initialize
& enable them on
log backend <log_backend_*> go
, sothat they function properly.
Fixes #84952
Fixes #84954
Testing
Console log