Skip to content

Debugging: Remove global debug flag#43

Open
hmaerki wants to merge 2 commits intoganehag:masterfrom
hmaerki:hmaerki/remove_global_debug
Open

Debugging: Remove global debug flag#43
hmaerki wants to merge 2 commits intoganehag:masterfrom
hmaerki:hmaerki/remove_global_debug

Conversation

@hmaerki
Copy link
Copy Markdown

@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