loguru icon indicating copy to clipboard operation
loguru copied to clipboard

Allow log sink to be filtered by level returned from logger.level()

Open davebirch opened this issue 5 years ago • 0 comments

Solves a pet niggle of mine ( #255 ) that you can't filter a log sink directly using the object that comes back from calling logger.level()

Kept the equality checks as strict as I can for now, but looking through some of the other tests, the levels seem generally keyed on the name.

If this is the case, I could update the equality check for RecordLevel to just check on the name (if other Level-like attributes exist perhaps?)

If this more loose equality were a reasonable plan, it might be worth adding to the Level object too. (as a note on this, there are some other possible things I've seen to do with equality on Level objects if you cache them and then update levels (even with the same values) - the eq on Level would also solve them, but I was concerned about side effects.

davebirch avatar May 06 '20 02:05 davebirch