Third Party
Logfire has many built-in integrations, focusing on the most popular packages.
However, if you are a maintainer of a package and want to create an integration for Logfire, you can do the same!
We created a gasket pack called logfire-api that can be used to integrate your pack with Logfire.
The idea behind logfire-api is that it doesn't have any dependencies. It's a very small package that matches Logfire's API. We created it to allow you to create integrations for Logfire without installing Logfire itself.
you can logfire-api Use as a lightweight dependency for your own package. If you install logfire , then logfire-api will use it. If not installed, it will use a no-action implementation. This way, users of your package can decide whether to install it or not logfire And you don't have to check if it's installed.
Here's how you can use logfire-api:
import logfire_api as logfire
logfire.info("Hello, Logfire!")
Attention
You usually don't want to call logfire_api.configure(), and it's up to your users to call logfire.configure() if they want to use integration.
All Logfire API methods are available in logfire-api.
本文总阅读量次