title: Use shared filter in Python without sharing state
body: <p>I'm using Python's logging library and I have implemented a filter-class that keeps track of records that are being emitted through a handler that stores the records on a file. The filter will return False if a record has been emitted before so that we are not alerted twice of the same event.</p>
  <p>The problem arose when I added a second handler which sends the record using the HTTPHandler. The handlers should have the same filter logic, so I reused the filter. When the first handler saves the record, the filter then keeps track of this separately, so when the second handler comes around it will find the record and return False.</p>
  <p>Is there a way for the filter to know which handler is sending the record so that I can differentiate between them or is there another way? I could create a duplicate filter class or subclass it, but that feels a bit wrong (don't repeat yourself and all that).</p>