[−][src]Struct holochain_logging::FastLoggerBuilder
Logger Builder used to correctly set up our logging capability.
Methods
impl<'a> FastLoggerBuilder
[src]
use holochain_logging::FastLoggerBuilder; let logger = FastLoggerBuilder::new() .set_level_from_str("Debug") .set_channel_size(512) .build(); assert!(logger.is_ok());
pub fn new() -> Self
[src]
It will init a FastLogger with the default argument (log level set to Info by default).
pub fn from_toml(toml_str: &str) -> Result<Self, Error>
[src]
Instantiate a logger builder from a config file in TOML format.
use holochain_logging::FastLoggerBuilder; let toml = r#" [logger] level = "debug" [[logger.rules]] pattern = ".*" color = "red" "#; let logger = FastLoggerBuilder::from_toml(toml) .expect("Fail to instantiate the logger from toml."); assert!(logger.build().is_ok());
pub fn level(&self) -> Level
[src]
pub fn set_level(&mut self, level: Level) -> &mut Self
[src]
pub fn set_level_from_str(&mut self, level: &str) -> &mut Self
[src]
Set the verbosity level of the logger from a string value: Trace, Debug, Info, Warn or Error.
pub fn set_channel_size(&mut self, channel_size: usize) -> &mut Self
[src]
Sets the capacity of our bounded message queue (i.e. there is a limit to how many messages it can hold at a time.). By default we use a queue of 1024.
pub fn timestamp_format(&mut self, timestamp_fmt: &str) -> &mut Self
[src]
Customize our logging timestamp.
pub fn add_rule_filter(&mut self, rule_filter: RuleFilter) -> &mut Self
[src]
Add filtering rules to the logging facility.
pub fn rule_filters(&self) -> &[RuleFilter]
[src]
Returns all the rules that will be applied to the logger.
pub fn redirect_to_file(&mut self, file_path: &str) -> &mut Self
[src]
Redirect log message to the provided file path.
pub fn file_path(&self) -> Option<String>
[src]
Returns the file path of the logs in the case we want to redirect them to a file.
pub fn build(&self) -> Result<FastLogger, SetLoggerError>
[src]
Registers a FastLogger as the comsumer of log facade so it becomes static and any further mutation are discarded.
pub fn build_test(&self) -> Result<FastLogger, SetLoggerError>
[src]
Dull log build, only used for test purposes because it actually doesn't log anything by not registering the logger.
Trait Implementations
impl Default for FastLoggerBuilder
[src]
Auto Trait Implementations
impl !RefUnwindSafe for FastLoggerBuilder
impl Send for FastLoggerBuilder
impl Sync for FastLoggerBuilder
impl Unpin for FastLoggerBuilder
impl UnwindSafe for FastLoggerBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,