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, Environment, init_subscriber};

let subscriber = configure_subscriber(
  builder("ping")
    .with_env(Environment::Dev)
    .build()
);

let _guard = init_subscriber(subscriber);

Structs

Information about the current app context like name or environment

SubscriberConfig configuration built via SubscriberConfigBuilder It contains

Uninstall guard for doing works in shutdown

Enums

All the possible environments in which the application can run.

Traits

EventFormatter allows you to customise the format of tracing::Event if the prima-json-logger feature is active

Functions

Configure a subscriber using SubscriberConfig. The configuration is behind feature flags

Initialize the subscriber and return the Uninstall guard