logging module, add SquasherHandler to forward log records to Squasher without replacing the rest of your logging setup.
Installation
Configuration
Create a handler once, attach it to your logger, and keep the rest of your logging pipeline unchanged.app/logging.py
The handler sends events on a background thread, so
logger.error() does not block while the HTTP request is in flight.
Usage Example
app/main.py
Call
flush() and close() during shutdown to make sure queued log records are delivered before
the process exits.Exception Handling
Uselogger.exception() inside an except block to include the exception type and traceback automatically.
exc_info is present, the handler sends both the exception type and the formatted stack trace alongside the log message, so the error shows up in Squasher with full debugging context.