Crate prima_tracing

Crate prima_tracing 

Source
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§

ContextInfo
Information about the current app context like name or environment
EnvironmentParseError
SubscriberConfig
SubscriberConfig configuration built via SubscriberConfigBuilder It contains
SubscriberConfigBuilder
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§

EventFormatter
EventFormatter allows you to customise the format of tracing::Event if the json-logger feature 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 Uninstall guard