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

Refactor logging for behaviors #2131

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bryanforbes
Copy link

I've refactored the logging in behaviors to be more granular with the goal being to eventually use more granular logging everywhere. The refactor is as follows:

  • Added CONFIG_ZMK_BEHAVIORS_LOG_LEVEL which, if unset, inherits the log level from CONFIG_ZMK_LOG_LEVEL (behavior.c and behavior_queue.c use this log level)
  • Added CONFIG_ZMK_BEHAVIOR_*_LOG_LEVEL for each behavior which, if unset, inherit from CONFIG_ZMK_BEHAVIORS_LOG_LEVEL
  • Ensured the behavior logging options show up as a sub-menu in menuconfig

With these additions, a developer can do the following:

  • Completely turn off all behavior logging by setting CONFIG_ZMK_BEHAVIORS_LOG_LEVEL_OFF=y
  • Only get logging for individual behaviors, such as caps word, by setting CONFIG_ZMK_BEHAVIORS_LOG_LEVEL_OFF=y and CONFIG_ZMK_BEHAVIOR_CAPS_WORD_LOG_LEVEL_DBG=y

@bryanforbes bryanforbes marked this pull request as ready for review January 23, 2024 22:31
@bryanforbes bryanforbes requested a review from a team as a code owner January 23, 2024 22:31
@caksoylar
Copy link
Contributor

I would wait for input on the idea/implementation from others before committing to doing it, but I'll drop this note: This would need docs updates for the new behavior guide and possibly some pointers in the USB logging page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants