service-logging 0.4.7

Asynchronous structured logging in tiny library (6KB) with clients for Coralogix and console.log. WASM compatible
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Example use of ConsoleLogger in non-wasm32 builds.
//
#[cfg(not(target_arch = "wasm32"))]
use service_logging::{log, ConsoleLogger, LogQueue, Severity};

#[cfg(not(target_arch = "wasm32"))]
#[tokio::test]
async fn test_console_log() {
    let mut log_queue = LogQueue::default();
    log!(log_queue, Severity::Info, one:"Thing One", two: "Thing Two");
    let logger = ConsoleLogger::init();
    logger
        .send("test_console_log", log_queue.take())
        .await
        .expect("send");
}