mikemalinowski / qute

A Qt helper library extending Marcus Ottosson's Qt.py library
MIT License
12 stars 3 forks source link

Minor: logging.getLogger may need to ensure there is a rootLogger beforehand. #4

Open ldunham1 opened 4 years ago

ldunham1 commented 4 years ago

https://github.com/mikemalinowski/qute/blob/3c5e1c34eba7153ba564910963f5c48c7abd1b4c/qute/constants.py#L9

It might be safer to ensure there is a root logger available. If there isnt byt this point , I dont think the log object will output.

Might be worth double checking if you need to call logging.basicConfig(level=logging.INFO) beforehand, perhaps ideally with your preferred log level. Its not used if a root logger already exists, so there shouldnt be a downside.

mikemalinowski commented 4 years ago

That sounds like a very good idea - do you have an implementation example at all?

ldunham1 commented 4 years ago
logging.basicConfig(level=logging.INFO)
log = logging.getLogger('qute') 

Is all you need :) basicConfig does all the heavy lifting (if you can call it heavy ;) )