Created
June 19, 2019 19:58
-
-
Save briggleman/13325fc4ec0a26e87ee1222af48ec532 to your computer and use it in GitHub Desktop.
Python Logging Filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# logging filter, adds uuid to log message | |
class ClientUUID(logging.Filter): | |
@lru_cache(maxsize=1) | |
def filter(self, record): | |
record.uuid = UUID | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment