pub struct Logger { /* private fields */ }Expand description
ftlog global logger
Implementations§
source§impl Logger
impl Logger
sourcepub fn init(self) -> Result<(), SetLoggerError>
pub fn init(self) -> Result<(), SetLoggerError>
Examples found in repository?
examples/lazy-bench.rs (line 40)
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
fn main() {
ftlog::Builder::new()
.root(std::io::sink())
.bounded(100_000, false)
// .unbounded()
.build()
.unwrap()
.init()
.unwrap();
run!("static string", {
ftlog::info!("ftlog message");
});
run!("with i32", {
ftlog::info!("ftlog: {}", 0i32);
});
run!("limit with i32", {
ftlog::info!(limit=3; "ftlog: {}", 0i32);
});
}More examples
examples/string-bench.rs (line 56)
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
fn main() {
ftlog::Builder::new()
.root(std::io::sink())
.format(StringFormatter)
.bounded(100_000, false)
// .unbounded()
.build()
.unwrap()
.init()
.unwrap();
run!("static string", {
ftlog::info!("ftlog message");
});
run!("with i32", {
ftlog::info!("ftlog: {}", 0i32);
});
run!("limit with i32", {
ftlog::info!(limit=3; "ftlog: {}", 0i32);
});
}