3.8.0
New features
- Add
safir.slack.webhook.SlackWebhookClient
and accompanying models to post a structured message to Slack via an incoming webhook. Add asafir.slack.blockkit.SlackException
base class that can be used to create exceptions with supplemental metadata that can be sent to Slack as a formatted alert. - Add a FastAPI route class (
safir.slack.webhook.SlackRouteErrorHandler
) that reports all uncaught exceptions to Slack using an incoming webhook. - Add
safir.datetime.format_datetime_for_logging
to convert adatetime
object into an easily human-readable representation. - Add
safir.testing.slack.mock_slack_webhook
and an associated mock class to mock a Slack webhook for testing. - Add
microseconds=True
parameter tosafir.datetime.current_datetime
to get adatetime
object with microseconds filled in. By default,current_datetime
suppresses the microseconds since databases often cannot store them, but there are some timestamp uses, such as error reporting, that benefit from microseconds and are never stored in databases.
What's Changed
Full Changelog: 3.7.0...3.8.0