Open raffaem opened 10 months ago
There are no multiple loggers with the same name.
Two loggers with the same name are the same logger, just assigned to two different variables.
This is why it's called logging.getLogger
, not logging.makeLogger
.
I'll have to test it first before merging. I remember there being an issue with initializing it within the class itself but I am not sure. I might have some time for it this week.
I just tried it out and I get indeed duplicate logging when I use your PR. When I install your PR and run the following, I get duplicate logging:
from polyfuzz import PolyFuzz
from_list = ["apple", "apples", "appl", "recal", "house", "similarity"]
to_list = ["apple", "apples", "mouse"]
model = PolyFuzz("TF-IDF", verbose=True)
model.match(from_list, to_list)
model1 = PolyFuzz("TF-IDF", verbose=True)
model1.match(from_list, to_list)
model2 = PolyFuzz("TF-IDF", verbose=True)
model2.match(from_list, to_list)
However, this is not the case when I just do pip install polyfuzz
.
fixed
I just tried it out and I get indeed duplicate logging when I use your PR. When I install your PR and run the following, I get duplicate logging:
@MaartenGr I fixed the bug
@raffaem Thanks for the fix. I will have to test it out later this week or next.
Thank you for the PR. I believe that when you put the logger inside the class, there will be issues with multiple loggers having the same name. For instance, if you create multiple instances of different PolyFuzz classes, multiple copies of loggers would be run.