HarrisKirk / blue-green-dreams

2 stars 1 forks source link

Addition of --log-level parameter to bgctl #109

Closed chrissound closed 9 months ago

chrissound commented 10 months ago

This should fix #101

Might need extra testing (can likely be done after I get the new linode token)

chrissound commented 9 months ago

This should now be fixed @HarrisKirk. The issue was the original 'debug' handler that gets set by default seems to still take effect after I run logging.basicConfig, hence I remove previously set log handlers when we set the log level from the parameter. This is a simple fix.

Potentially there is a more elegant solution - but it'd likely take quite a bit more time and we'd have to keep track of the log level throughout the program, it might get a bit messy if we were relying on the default debug setup in most places. Perhaps there is another approach.

I'd go with the simple fix for now, unless you're planning to do more sophisticated logging.

HarrisKirk commented 9 months ago

@chrissound this fix looks perfect. Makes sense. Thanks.