Shiny Bugsnag integration for Starlette framework
Project description
starlette-x-bugsnag
Shiny Bugsnag integration for Starlette framework ✨
Scope details, local variables and installed packages will be attached to each event for ease of debugging.
Installation:
pip install starlette-x-bugsnag
Usage:
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.requests import Request
from starlette.responses import JSONResponse
from starlette.routing import Route
from starlette_x_bugsnag.middleware import BugsnagMiddleware
async def home(request: Request) -> JSONResponse:
return JSONResponse({"message": "Hello world!"})
routes = [Route("/", home)]
# Using application constructor
application = Starlette(
routes=routes, middleware=[Middleware(BugsnagMiddleware, api_key="secret")],
)
# Or using add_middleware method
application.add_middleware(BugsnagMiddleware, api_key="secret")
BugsnagMiddleware
accepts same arguments as bugsnag.configure
function, so you can pass additional information
about your app, such as app_version
.
application = Starlette(
routes=routes,
middleware=[
Middleware(
BugsnagMiddleware,
api_key="secret",
app_version="1.2.3",
release_stage="production",
project_root=None, # Save traceback not only from the current directory
),
],
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for starlette-x-bugsnag-0.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74b7819d7b831ef750f8bf5134f7e2b84bfa7f8094e4561d4e591fe72dbe1e9e |
|
MD5 | f4c2c52de62c10023379b632d839e2dd |
|
BLAKE2b-256 | 0b8d002440bcf9c6ec7aabf041fd6b240b7248fde7304c3d956237fed464ebe0 |
Close
Hashes for starlette_x_bugsnag-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 681a0261645fe2ab37db763d6e22e4662ecbf7cb27fcea37c085a9a74932c936 |
|
MD5 | e25a7753e236b3f7c69632a1fbf67a29 |
|
BLAKE2b-256 | ab5fd2f748e36e6bd86f00f8e07c835d5ce64c71cc916206b56ba83834b6b901 |