Open Serlonwann opened 1 week ago
Hi @Serlonwann.
It seems you simply need to delete the self.logger.remove()
lines in the __init__()
method of your classes. Calling logger.remove()
will erase all previously installed handlers. That will lead to unexpected results depending on which order you instantiate Test1
and Test2
classes. Instead, yo can call logger.remove()
at the beginning of your if __name__ == "__main__"
branch.
I have two classes in two python files that need two separate log files. The two classes would look like this :
and
And then my main like that :
But i can't manage two have the logs from the test2() method, which parent class is instantiated first. I read the docs and didn't find the answer to this problem. Thanks for help !