/// Spawn a task to read from the kernel's debuglog. The returned future completes once existing
/// messages have been ingested.
Spawn a task to read from the kernel's debuglog. The returned future completes once existing
messages have been ingested.
Spawn a task to read from the kernel ' s debuglog . The returned future completes once existing messages have been ingested .
pub async fn spawn_debuglog_drainer<K>(&self, klog_reader: K) -> Result<(), Error>
    where
        K: debuglog::DebugLog + Send + Sync + 'static,
    {
        let mut kernel_logger = debuglog::DebugLogBridge::create(klog_reader);
        for log_msg in
            kernel_logger.existing_logs().await.context("reading from kernel log iterator")?
        {
            self.ingest_message(log_msg, LogSource::Kernel).await;
        }
        let manager = self.clone();
        fasync::spawn(async move {
            let drain_result = kernel_logger
                .listen()
                .try_for_each(|log_msg| manager.ingest_message(log_msg, LogSource::Kernel).map(Ok));
            if let Err(e) = drain_result.await {
                eprintln!(
                    "ERROR: important logs may be missing from system log.\
                           failed to drain kernel log: {:?}",
                    e
                );
            }
        });
        Ok(())
    }
pub async fn spawn_debuglog_drainer < K > ( & self , klog_reader : K ) -> Result < ( ) , Error > where K : debuglog :: DebugLog + Send + Sync + ' static , { let mut kernel_logger = debuglog :: DebugLogBridge :: create ( klog_reader ) ; for log_msg in kernel_logger . existing_logs ( ) . await . context ( " " ) ? { self . ingest_message ( log_msg , LogSource :: Kernel ) . await ; } let manager = self . clone ( ) ; fasync :: spawn ( async move { let drain_result = kernel_logger . listen ( ) . try_for_each ( | log_msg | manager . ingest_message ( log_msg , LogSource :: Kernel ) . map ( Ok ) ) ; if let Err ( e ) = drain_result . await { eprintln ! ( " \
 " e ) ; } } ) ; Ok ( ( ) ) }
Spawn a task to read from the kernel's debuglog.
Spawn a task to read from the kernel ' s debuglog .
&self
klog_reader
K