Expand description
prima_tracing provide an handy way for configuring the tracing crate with
support for JSON output formatter and integration with opentelemetry
§Usage
use prima_tracing::{builder, configure_subscriber, Country, Environment, init_subscriber};
let subscriber = configure_subscriber(
builder("ping")
.with_country(Country::Common)
.with_env(Environment::Dev)
.build()
);
let _guard = init_subscriber(subscriber);Re-exports§
pub use tracing;
Macros§
- report_
error - Create a tracing error event, casting the error to &dyn std::error::Error for [layer::ErrorLayer], and adding the type name as error.kind.
Structs§
- Context
Info - Information about the current app context like name or environment
- Environment
Parse Error - Subscriber
Config SubscriberConfigconfiguration built viaSubscriberConfigBuilderIt contains- Subscriber
Config Builder - Tracing
- Uninstall
- Uninstall guard for doing works in shutdown
Enums§
- Country
- All the possible countries in which the application can run.
- Environment
- All the possible environments in which the application can run.
Traits§
- Event
Formatter EventFormatterallows you to customise the format oftracing::Eventif thejson-loggerfeature is active
Functions§
- builder
- Create a
SubscriberConfigBuilder - configure_
subscriber - Configure a subscriber using
SubscriberConfig. The configuration is behind feature flags - init_
subscriber - Initialize the subscriber and return the
Uninstallguard