rakhas_logger 0.1.0

Async logging library with batch processing and graceful shutdown
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use tokio::sync::oneshot;

#[derive(Debug)]
pub enum LogCommand {
    Write(String),
    Stop(oneshot::Sender<()>),
}

impl LogCommand {
    pub fn message(&self) -> String {
        if let LogCommand::Write(message) = self {
            message.clone()
        } else {
            String::new()
        }
    }
}