I'd like to create a logger for a python project. I want to make sure that i'm using the same logger for every module in the project. What is the best way to do this? It seems I need a global logging object? Or perhaps a logging module that is imported by every other module? I want to make sure that I'm always writing to the same log file.
I'm using python's logger and handler already. The problem is that I have to define which file the logger will write to in every module. I'd like to define the log file path once and have it be used for every module.
As you say, look at Python's logging
module
It provides objects like Logger and Handler, I think it can work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With