Skip to main content

log/
log.rs

1/*!
2Using integration with [log](https://docs.rs/log/latest/log/index.html)
3How to run:
41) Open another terminal and run a program that listens for TCP connections on port 8080, such as ```ncat -l --keep-open 8080```
52) Run 
6```shell
7$ cargo run --example log
8```
9*/
10use std::time::Duration;
11
12use logcast::init_on_addr;
13fn main() {
14    init_on_addr("127.0.0.1:8080");
15    log::info!("The logger seems to work");
16    std::thread::sleep(Duration::from_secs(1)); // If the main thread finishes before the logs
17    // are sent the logs cannot be delivered
18}