MaartenGr / PolyFuzz

Fuzzy string matching, grouping, and evaluation.
https://maartengr.github.io/PolyFuzz/
MIT License
736 stars 67 forks source link

Nolog #71

Open raffaem opened 10 months ago

MaartenGr commented 10 months ago

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.

raffaem commented 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.

MaartenGr commented 10 months ago

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.

MaartenGr commented 10 months ago

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.

raffaem commented 10 months ago

fixed

raffaem commented 9 months ago

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

MaartenGr commented 9 months ago

@raffaem Thanks for the fix. I will have to test it out later this week or next.