pub fn build(self) -> (Dispatch, Handle) {
        let registry = tracing_subscriber::registry();

        // Build the default stdout logger.
        let (registry, level) = {
            // Make a formatted logging layer configured to write to stdout.
            let stdout = if self.format.trim().eq_ignore_ascii_case("json") {
                self.mk_json()
            } else {
                self.mk_plain()
            };

            // Parse the initial filter. If the filter includes invalid
            // directives, an error is printed sto stderr.
            let filter = level::filter_builder().parse_lossy(self.filter);

            // Make the level dynamic and register the layer.
            let (layer, level) = reload::Layer::new(stdout.with_filter(filter));
            (registry.with(Some(layer)), level)
        };

        // Log streaming (via the admin API) is currently feature-gated. When it
        // is enabled, the admin handle can use the stream handle to register
        // new subscribers dynamically.
        #[cfg(feature = "stream")]
        let (registry, stream) = {
            let (handle, layer) = stream::StreamHandle::new();
            (registry.with(layer), handle)
        };

        // Access logging is optionally enabled process-wide.
        let registry = registry.with(self.access_log.map(access_log::build));

        // The handle controls the logging system at runtime.
        let handle = Handle {
            level: Some(level::Handle::new(level)),
            #[cfg(feature = "stream")]
            stream,
        };

        (registry.into(), handle)
    }
/// Builds a tracing subscriber dispatcher and a handle that can control
/// logging behavior at runtime (e.g., from an admin server).
///
/// The log dispatcher handles:
///
/// - process diagnostic logging to stdout;
/// - optional access logging to stderr;
/// - if the `stream` feature is enabled, on-demand log streaming via the
///   returned `Handle`
Builds a tracing subscriber dispatcher and a handle that can control
logging behavior at runtime .

The log dispatcher handles.

process diagnostic logging to stdout;
optional access logging to stderr;
if the `stream` feature is enabled, on-demand log streaming via the
returned `Handle`
Builds a tracing subscriber dispatcher and a handle that can control logging behavior at runtime . The log dispatcher handles . process diagnostic logging to stdout ; optional access logging to stderr ; if the ` stream ` feature is enabled on - demand log streaming via the returned ` Handle `
pub fn build(self) -> (Dispatch, Handle) {
        let registry = tracing_subscriber::registry();
        // Build the default stdout logger.
        let (registry, level) = {
            // Make a formatted logging layer configured to write to stdout.
            let stdout = if self.format.trim().eq_ignore_ascii_case("json") {
                self.mk_json()
            } else {
                self.mk_plain()
            };
            // Parse the initial filter. If the filter includes invalid
            // directives, an error is printed sto stderr.
            let filter = level::filter_builder().parse_lossy(self.filter);
            // Make the level dynamic and register the layer.
            let (layer, level) = reload::Layer::new(stdout.with_filter(filter));
            (registry.with(Some(layer)), level)
        };
        // Log streaming (via the admin API) is currently feature-gated. When it
        // is enabled, the admin handle can use the stream handle to register
        // new subscribers dynamically.
        #[cfg(feature = "stream")]
        let (registry, stream) = {
            let (handle, layer) = stream::StreamHandle::new();
            (registry.with(layer), handle)
        };
        // Access logging is optionally enabled process-wide.
        let registry = registry.with(self.access_log.map(access_log::build));
        // The handle controls the logging system at runtime.
        let handle = Handle {
            level: Some(level::Handle::new(level)),
            #[cfg(feature = "stream")]
            stream,
        };
        (registry.into(), handle)
    }
pub fn build ( self ) -> ( Dispatch , Handle ) { let registry = tracing_subscriber :: registry ( ) ; // Build the default stdout logger. let ( registry , level ) = { // Make a formatted logging layer configured to write to stdout. let stdout = if self . format . trim ( ) . eq_ignore_ascii_case ( " " ) { self . mk_json ( ) } else { self . mk_plain ( ) } ; // Parse the initial filter. If the filter includes invalid // directives, an error is printed sto stderr. let filter = level :: filter_builder ( ) . parse_lossy ( self . filter ) ; // Make the level dynamic and register the layer. let ( layer , level ) = reload :: Layer :: new ( stdout . with_filter ( filter ) ) ; ( registry . with ( Some ( layer ) ) , level ) } ; // Log streaming (via the admin API) is currently feature-gated. When it // is enabled, the admin handle can use the stream handle to register // new subscribers dynamically. # [ cfg ( feature " " ) ] let ( registry , stream ) = { let ( handle , layer ) = stream :: StreamHandle :: new ( ) ; ( registry . with ( layer ) , handle ) } ; // Access logging is optionally enabled process-wide. let registry = registry . with ( self . access_log . map ( access_log :: build ) ) ; // The handle controls the logging system at runtime. let handle = Handle { level : Some ( level :: Handle :: new ( level ) ) , # [ cfg ( feature " " ) ] stream , } ; ( registry . into ( ) , handle ) }
Builds a tracing subscriber dispatcher and a handle that can control
logging behavior at runtime (e.g., from an admin server).
Builds a tracing subscriber dispatcher and a handle that can control logging behavior at runtime ( e . g . from an admin server ) .
self