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 52
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=3i64; "ftlog: {}", 0i32);
});
log::logger().flush();
}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 68
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=3i64; "ftlog: {}", 0i32);
});
log::logger().flush();
}Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Logger
impl Send for Logger
impl Sync for Logger
impl Unpin for Logger
impl !UnwindSafe for Logger
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more