5 releases

0.1.4 Jan 11, 2020
0.1.3 Aug 18, 2019
0.1.2 Aug 13, 2019
0.1.1 Aug 5, 2019
0.1.0 Aug 5, 2019

#32 in #init

32 downloads per month

MIT license

5KB
53 lines

Glore

Rust Log

HowTo:

1- Use glore::GLORE at the root of your project

2- Add a log target with glore::init($target) $target is anything that impl Write

3- log!

example of usage:

use glore::{init, log, GLORE};

let f = std::fs::OpenOptions::new()
	.append(true)
	.open("log.txt")
	.unwrap();
let stdout = std::io::stdout();

init(stdout);
log!("hello ====");
log!("world");

init(f);
log!("hello ====");
std::thread::spawn(|| {
	log!("world");
})
.join();

Important

  • This crate uses unsafe (to modify global log)

lib.rs:

glore at log

HowTo:

1- Use glore::GLORE at the root of your project

2- Add a log target with glore::init($target) $target is anything that impl Write

3- log!

example of usage:

use glore::{init, log, GLORE};

   let f = std::fs::OpenOptions::new()
	.append(true)
	.open("log.txt")
	.unwrap();
let stdout = std::io::stdout();

init(stdout);
log!("hello ====");
log!("world");

init(f);
log!("hello ====");
std::thread::spawn(|| {
	log!("world");
})
.join();

No runtime deps