SilentSys / orhelper

orhelper is a module which aims to facilitate interacting and scripting with OpenRocket from Python
GNU General Public License v2.0
16 stars 18 forks source link

Move orhelper logger out of file scope #14

Closed Jashaszun closed 10 months ago

Jashaszun commented 10 months ago

Since the orhelper logger is created in the file scope of _orhelper.py, it is created when orhelper is imported. This means that to assign settings to that logger, clients have to import logging themselves, get the logger that orhelper will be assigned with logging.getLogger('orhelper._orhelper'), assign settings, and then finally import orhelper. This is quite ugly in client code and it would be much nicer if the logger was created after import, i.e. in the OpenRocketInstance constructor.

Jashaszun commented 10 months ago

Never mind, you can actually assign orhelper logger settings after import.