Conditionally emit the specified logging record. Emission depends on filters which may have been added to the handler. Wrap the actual emission of the record with acquisition/release of the I/O thread lock. Returns whether the filter passed the record for
(self, record)
| 963 | 'by Handler subclasses') |
| 964 | |
| 965 | def handle(self, record): |
| 966 | """ |
| 967 | Conditionally emit the specified logging record. |
| 968 | |
| 969 | Emission depends on filters which may have been added to the handler. |
| 970 | Wrap the actual emission of the record with acquisition/release of |
| 971 | the I/O thread lock. Returns whether the filter passed the record for |
| 972 | emission. |
| 973 | """ |
| 974 | rv = self.filter(record) |
| 975 | if rv: |
| 976 | self.acquire() |
| 977 | try: |
| 978 | self.emit(record) |
| 979 | finally: |
| 980 | self.release() |
| 981 | return rv |
| 982 | |
| 983 | def setFormatter(self, fmt): |
| 984 | """ |