mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-31 17:28:12 +00:00
fix: resolve all doctest failures in rustfs-obs crate
This commit is contained in:
+11
-5
@@ -22,11 +22,14 @@
|
||||
///
|
||||
/// ## Usage
|
||||
///
|
||||
/// ```rust
|
||||
/// ```no_run
|
||||
/// use rustfs_obs::{AppConfig, init_obs};
|
||||
///
|
||||
/// # #[tokio::main]
|
||||
/// # async fn main() {
|
||||
/// let config = AppConfig::default();
|
||||
/// let (logger, guard) = init_obs(config);
|
||||
/// let (logger, guard) = init_obs(config).await;
|
||||
/// # }
|
||||
/// ```
|
||||
mod config;
|
||||
mod entry;
|
||||
@@ -64,11 +67,14 @@ use tracing::{error, info};
|
||||
/// A tuple containing the logger and the telemetry guard
|
||||
///
|
||||
/// # Example
|
||||
/// ```
|
||||
/// ```no_run
|
||||
/// use rustfs_obs::{AppConfig, init_obs};
|
||||
///
|
||||
/// # #[tokio::main]
|
||||
/// # async fn main() {
|
||||
/// let config = AppConfig::default();
|
||||
/// let (logger, guard) = init_obs(config);
|
||||
/// let (logger, guard) = init_obs(config).await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub async fn init_obs(config: AppConfig) -> (Arc<Mutex<Logger>>, telemetry::OtelGuard) {
|
||||
let guard = init_telemetry(&config.observability);
|
||||
@@ -97,7 +103,7 @@ pub async fn init_obs(config: AppConfig) -> (Arc<Mutex<Logger>>, telemetry::Otel
|
||||
/// A reference to the global logger instance
|
||||
///
|
||||
/// # Example
|
||||
/// ```
|
||||
/// ```no_run
|
||||
/// use rustfs_obs::get_logger;
|
||||
///
|
||||
/// let logger = get_logger();
|
||||
|
||||
Reference in New Issue
Block a user