Mercurial > lbo > hg > leveldb-rs
view src/infolog.rs @ 243:8c4330364415
table_reader, option: Remove Mutex around BlockCache
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sat, 16 Sep 2017 08:16:28 +0000 |
parents | b5df6a4ca16f |
children | e9ccc908caff |
line wrap: on
line source
use std::io::Write; pub struct Logger(pub Box<Write>); #[macro_export] macro_rules! log { ($l:expr) => ($l.borrow_mut().0.write("\n".as_bytes()).is_ok()); ($l:expr, $fmt:expr) => ($l.borrow_mut().0.write(concat!($fmt, "\n").as_bytes()).is_ok()); ($l:expr, $fmt:expr, $($arg:tt)*) => ($l.borrow_mut().0.write_fmt(format_args!(concat!($fmt, "\n"), $($arg)*)).is_ok()); }