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

osgar/drivers/pcan.py - change log level from debug to info #982

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

m3d
Copy link
Member

@m3d m3d commented Mar 10, 2024

Python CAN has by default (to my surprise) log level "debug" (!), which is basically impossible to use once the communication is running (the CAN messages are printed). This one-liner allows change in config + sets as default "info".
For more info see:
https://python-can.readthedocs.io/en/v4.3.1/internal-api.html#can.util.set_logging_level

can.util.set_logging_level(level_name)[source]

Set the logging level for the “can” logger.

Parameters:

    level_name ([str](https://docs.python.org/3/library/stdtypes.html#str)) – One of: ‘critical’, ‘error’, ‘warning’, ‘info’, ‘debug’, ‘subdebug’, or the value [None](https://docs.python.org/3/library/constants.html#None) (=default). Defaults to ‘debug’.
Return type:

    None

@m3d m3d requested a review from tajgr March 10, 2024 19:54
Copy link
Collaborator

@tajgr tajgr left a comment

Choose a reason for hiding this comment

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

Thanks

@m3d m3d merged commit 8cee8fa into master Mar 11, 2024
6 checks passed
@m3d m3d deleted the feature/pcan-set-logging-level branch March 11, 2024 06:16
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