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