Struct ftlog::Logger

source ·
pub struct Logger { /* private fields */ }
Expand description

ftlog global logger

Implementations§

source§

impl Logger

source

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
Hide additional 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);
    });
}

Trait Implementations§

source§

impl Drop for Logger

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Log for Logger

source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be logged. Read more
source§

fn log(&self, record: &Record<'_>)

Logs the Record. Read more
source§

fn flush(&self)

Flushes any buffered records.

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> Any for Twhere
T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.