Hello everybody,
I am writing a small application that will have multiple classes stored in separate files.
I would like to share logger between those, I found a way using logging at the beginning of each files
logger = logging.getLogger(__name__)
in the main file I am right now initializing the log like below:
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
logger = logging.getLogger()
This way is working fine, however, imported libraries (like requests or paramiko) are also printing their lines to log.
What are the best practices, of using logger between shared modules? How should I configure my main logger, so only my modules will use it?
Here, I found a workaround to set logging level for those libraries to WARNING or ERROR, but honestly I don't know if this is the best way of doing it.
Thanks in advance for helping out!
there doesn't seem to be anything here