Since basicConfig is called as a import side-effect of pvlib, any software that imports anything from pvlib can not use it's own basicConfig (if basicConfig was already called, any further call just does nothing - not even giving a warning).
This leads to unexpected behavior (no more debug output) which is rather hard to track down.
I don't know whether it is bad to copy issues word-by-word, but this affects pvlib as well: https://github.com/circus-tent/circus/issues/826
The problem can be reproduced using the code form Python logging cookbook:
https://docs.python.org/2/howto/logging-cookbook.html#using-logging-in-multiple-modules
Adding import pvlib will cause all logging to be ouputted to terminal.
Maybe this is by design, but it's a bit difficult to get around.
I think all logging in pvlib can be removed, with maybe a couple of calls being replaced with warnings. Most pvlib logging is a holdover from my early efforts to remove print and some debugging.
@Gemmu if you set propagate to False then it shouldn't inherit the root logger.
@wholmgren instead of using basicConfig create a pvlib logger that has it's own handlers and formatters so it doesn't propagate. See the HOWTO on configuring loggers or the logging cookbook
@mikofski sure, but I don't think pvlib should be logging anything. Do you find pvlib logging to be useful? I think issuing warnings and pushing developers towards pdb is more appropriate for the vast majority of the existing logging calls.
@mikofski, Thank You for the suggestion. Weird enough, setting logger.propagate = False worked great even when only set in the examples main.py file. The auxiliary module didn't need the propagate-property to be set.
I dare not say anything about pvlib's logging requirements, as I'm only working with it indirectly.
Most helpful comment
@mikofski, Thank You for the suggestion. Weird enough, setting
logger.propagate = Falseworked great even when only set in the examplesmain.pyfile. The auxiliary module didn't need thepropagate-property to be set.I dare not say anything about pvlib's logging requirements, as I'm only working with it indirectly.