Lib containing the client and server for a centralized logging setup.
To use rokkett-logger, add it as a dependency to your Cargo.toml
.
bash
$ cargo add rokkett-logger
To configure the logger, create a new RokkettLogger
which shall be initialized only once before any logs are generated.
```rust
async fn main() { // register logger RokkettLogger::new("127.0.0.1:5500", "My App", Some("secret")) .expect("failed to create logger");
// start logging :)
log::info!("Hello, world!");
} ```
See examples for more examples.
To use rokkett-logger, add it as a dependency to your Cargo.toml
.
bash
$ cargo add rokkett-logger
```rust
async fn main() { let onlogin = |token, _addr| token == "secret".tostring(); let onlog = |message, _addr| { println!("{message}"); Status::Ok }; Server::new(onlogin, on_log).listen("127.0.0.1", 5500).await; } ```
See examples for more examples.
Rokkett-Logger is distributed under the terms of the Apache-2.0 license.
Find an easy explanation on choosealicense.com/licenses/apache-2.0.