-
Notifications
You must be signed in to change notification settings - Fork 8
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
Intended way to get DEBUG logging? #83
Comments
I will dive deeper into this today and maybe try to add a |
This took quite a bit of time and then it made me give up trying to think of a reasonable way to integrate in the tools, and go for a quick fix for just my plugin instead: I went with external overriding in my plugin's
That way I can use |
Warning, weird footgun! Due to reasons I switched to using the same logger everywhere via:
Don't ask me why, but now I could not use the logger object returned by
Changing the level of the logger returned by Instead I went with:
|
I cannot figure out how to get
DEBUG
logging messages to appear with this. I have not traced a message through all the code so sorry if below is stupid:Logging is set up following https://github.com/GispoCoding/qgis_plugin_tools/blob/main/docs/usage.md#logging
A
LOGGER.debug('Log some debug messages')
just goes into the void. I am looking at stdout/stderr and the QGIS message log. The docs made me expect that debug messages would be handled in a "visible" way.I see that the plugin has some logic around logging levels where
DEBUG
is turned into QGIS'INFO
level (as QGIS has noDEBUG
level). That seems to work fine by itself. Yet the messages do not appear in the QGIS message log.In
qgis_plugin_tools/tools/custom_logging.py
Lines 26 to 31 in fd8650d
INFO
as level. Their levels are used in other places to set the minimum common level. So just looking at that, it makes sense that DEBUG messages are not logged. But I thought they would be turned intoINFO
level automagically somewhere?I tried
LOGGER.setLevel(logging.DEBUG)
with no luck.I tried setting all the handlers levels to
DEBUG
, this made them appear asDEBUG
logs in the terminal andINFO
logs in QGIS. How can I achieve that without modifying the code of this module?The text was updated successfully, but these errors were encountered: