iamkubi / pydactyl

Python wrapper for the Pterodactyl Panel API
MIT License
69 stars 21 forks source link

pydactyl overrides the logging level of the root python logger #82

Open cswimr opened 7 months ago

cswimr commented 7 months ago

Describe the bug If you pass debug=True to the PterodactylClient class when initializing it, all loggers running in your codebase will be forced to debug level. If you do not pass debug to the PterodactylClient class, or pass it with the value False, all loggers in your codebase will be forced to error level.
Relevant broken code: https://github.com/iamkubi/pydactyl/blob/6f7d30089841791fb277bc4998a29b9cd91b43c1/pydactyl/api_client.py#L32

To Reproduce Create a logger that logs to the info level, and initialize a PterodactylClient instance. Any info level logging messages output by the initial logger will be ignored.

Expected behavior Pydactl shouldn't interfere with loggers outside of Pydactl.

Environment

Additional context This could easily be solved by allowing us to pass our own instance of logging.Logger to the PterodactylClient class, instead of using a custom logger.

iamkubi commented 7 months ago

Makes sense, I'll try to get this out soon.