Open sdenef-adeo opened 1 year ago
Hi @sdenef-adeo, which IDE do you use? Using DEBUG mode should be as simple as setting the DEBUG
env variable to 1
. This can be done in multiple ways. For example with a .env
file that is automatically picked up by the IDE or the test engine. Or by setting the env variable explicitly during tests.
Hi @lvaylet ,
Did you try?
I use Intellij IDEA. Here are the ouputs for the same launch configuration (DEBUG=1)
Against master branch:
Against my PR branch:
AFAIU the DEBUG is never read when running tests as it does not reach utils.setup_logging() nor constants.DEBUG
Got it. I assumed "testing" meant "running slo-generator compute ...
manually in my terminal". Not "unit testing". So yes, this does make sense.
Let me take a look and see how we can leverage the existing utils.setup_logging()
.
Is there a specific reason why you decided not to call utils.setup_logging()
?
We could rewrite it so it remains compatible with the current usage (for example by adding options with default values) and let you use debug mode in unit tests at the same time.
Is there a specific reason why you decided not to call
utils.setup_logging()
?
Hello,
No reason except I'm not familiar with Python logging. ;)
When testing, I would like my IDE to output logs to the console. And I would like to set DEBUG mode like we do for running code.
I'm not this is the best way to do. And how to avoid duplicated code, already existing in
utils.setup_logging()
function. Feel free to improve my code.