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

Debugging: Remove global debug flag #43

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

Conversation

hmaerki
Copy link

@hmaerki hmaerki commented Jan 23, 2025

This PR resolves #33.

Remove g.debug

The global g.debug flag allow to enable/disable logging.

In this PR, I removed this flag as the python logging module already provides mechanisms to control logging.

This change does not change the API nor the behaviour.

Remove logging config

In meterbus/serial.py on global level logging.basicConfig(level=logging.INFO) was called.

This might have unwanted sideeffects:

  • Logging might be disabled at program start
  • As soon as meterbus/serial.py is loaded, logging might start.

So I removed logging.basicConfig(level=logging.INFO).

The python logging suggests, that the application should configure logging and not a module at load time.

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.

Request: 'g.debug' -> python logging
1 participant