1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Built-in tracing support for the [`Client`](crate::Client).
//!
//! Enable request/response tracing by calling
//! [`ClientConfig::enable_tracing`](crate::ClientConfig::enable_tracing) or
//! by using the [`with_tracing`] convenience function.
//!
//! When tracing is enabled, every request logs the HTTP method, URL, response
//! status, and elapsed duration at `DEBUG` level via the [`tracing`] crate.
//!
//! # Example
//!
//! ```
//! use typeway_client::{ClientConfig, with_tracing};
//!
//! // Option 1: builder method
//! let config = ClientConfig::default().enable_tracing();
//!
//! // Option 2: convenience function
//! let config = with_tracing(ClientConfig::default());
//! ```
use crateClientConfig;
/// Enable built-in tracing on the given [`ClientConfig`].
///
/// This is a convenience wrapper around
/// [`ClientConfig::enable_tracing`](ClientConfig::enable_tracing) for use in
/// a functional pipeline.
///
/// # Example
///
/// ```
/// use typeway_client::{ClientConfig, RetryPolicy, with_tracing};
///
/// let config = with_tracing(
/// ClientConfig::default()
/// .retry_policy(RetryPolicy::none()),
/// );
/// ```