otlp-logger 0.6.2

A simple convenience crate to configure an OpenTelemetry otlp endpoint with Tokio Tracing.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use tracing::{info, error};


#[tokio::test]
async fn test_init() {
    if std::env::var("RUST_LOG").is_err() {
        unsafe {
            std::env::set_var("RUST_LOG", "info");
        }
    }
    let logger = otlp_logger::init().await.expect("Initialized logger");
    info!("This is an info message");
    error!("This is an error message");

    logger.shutdown();
}