Observability and tracing

The library uses popular tracing crate for logs and distributed traces (spans). To improve observability for your specific cases, additionally to the fields provided by library, you can inject your own trace fields:

use slack_morphism::prelude::*;
use tracing::*;

// While Team ID is optional but still useful for tracing and rate control purposes
let token: SlackApiToken =

// Let's create our own user specific span first
let my_custom_span = span!(Level::DEBUG, "My scope", my_scope_attr = "my-scope-value");
debug!("Testing tracing abilities");

// Sessions are lightweight and basically just a reference to client and token
    .run_in_session(&token, |session| async move {
        let test: SlackApiTestResponse = session
        println!("{:#?}", test);

        let auth_test = session.auth_test().await?;
        println!("{:#?}", auth_test);