Crates.io | logosaurus |
lib.rs | logosaurus |
version | 0.5.0 |
source | src |
created_at | 2020-10-02 18:38:23.102766 |
updated_at | 2020-10-06 10:14:49.05659 |
description | Logging implementation modeled after the Go standard library's log package. |
homepage | |
repository | https://github.com/littleroot/logosaurus |
max_upload_size | |
id | 295510 |
size | 21,961 |
Rust logging implementation modeled after the Go standard library log package.
It works with the log
crate.
See docs.rs.
use log::{debug};
use logosaurus::{Logger};
fn main() {
logosaurus::init(Logger::default()).unwrap();
debug!("hello, world"); // DEBUG 2020/10/02 21:27:03 hello, world
}
use log::{self, debug};
use logosaurus::{Logger, L_STD, L_SHORT_FILE, L_MICROSECONDS};
use std::io;
fn main() {
let logger = Logger::builder(io::stdout())
.set_level(log::LevelFilter::Debug)
.set_flags(L_STD | L_SHORT_FILE | L_MICROSECONDS)
.set_prefix("myprogram: ")
.build();
logosaurus::init(logger).unwrap();
debug!("hello, world"); // myprogram: DEBUG 2020/10/02 21:27:03.123123 main.rs:12: hello, world
}