loguru
loguru copied to clipboard
Allow log sink to be filtered by level returned from logger.level()
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.