[][src]Struct holochain_logging::FastLogger

pub struct FastLogger { /* fields omitted */ }

The logging struct where we store everything we need in order to correctly log stuff.

Methods

impl FastLogger[src]

pub fn level(&self) -> Level[src]

Returns the current log level defined. Can be one of: Trace, Debug, Info, Warn or Error.

pub fn rule_filters(&self) -> &Vec<RuleFilter>[src]

Returns all the rules defined.

pub fn should_log_in(&self, args: &str) -> Option<String>[src]

Returns the color of a log message if the logger should log it, and None other wise. We want to return the last match so we can combine rules and filters.

pub fn add_rule_filter(&mut self, rule_filter: RuleFilter)[src]

Add a rule filter to the list of existing filter. This function has to be called before registering the logger or it will do nothing because the logger becomes static.

pub fn flush_filters(&mut self)[src]

Flush all filter from the logger. Once a logger has been registered, it becomes static and so this function doesn't do anything.

pub fn flush(&self)[src]

Flushes the write buffer inside the logging thread.

pub fn shutdown(&mut self)[src]

Gracefully shutdown the logging thread and flush its writing buffer.

Trait Implementations

impl Drop for FastLogger[src]

fn drop(&mut self)[src]

This a fall back solution to give some arbitrary time to the logging thread to finish it's business.

impl Log for FastLogger[src]

fn enabled(&self, metadata: &Metadata) -> bool[src]

Determines if a log message with the specified metadata would be logged.

fn log(&self, record: &Record)[src]

This is where we build the log message and send it to the logging thread that is in charge of formatting and printing the log message.

fn flush(&self)[src]

Flushes any buffered records.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]