Struct nih_plug::debug::nih_log::LoggerBuilder
pub struct LoggerBuilder { /* private fields */ }
Expand description
Constructs an NIH-log logger.
Implementations§
§impl LoggerBuilder
impl LoggerBuilder
pub fn new(max_log_level: LevelFilter) -> LoggerBuilder
pub fn new(max_log_level: LevelFilter) -> LoggerBuilder
Create a builder for a logger. The logger can be installed using the
build_global()
function.
pub fn build_global(self) -> Result<(), SetLoggerError>
pub fn build_global(self) -> Result<(), SetLoggerError>
Install the configured logger as the global logger. The global logger can only be set once.
pub fn always_show_module_path(self) -> LoggerBuilder
pub fn always_show_module_path(self) -> LoggerBuilder
Always show the module path. Normally this is only shown for the messages on the Debug
level or on higher verbosity levels. Useful for debugging.
pub fn filter_crate(self, crate_name: impl Into<String>) -> LoggerBuilder
pub fn filter_crate(self, crate_name: impl Into<String>) -> LoggerBuilder
Filter out log messages produced by the given crate.
pub fn filter_module(self, crate_name: impl Into<String>) -> LoggerBuilder
pub fn filter_module(self, crate_name: impl Into<String>) -> LoggerBuilder
Filter out log messages produced by the given module. Module names are matched exactly and case sensitively. Filtering based on a module prefix is currently not supported.
pub fn with_output_target(
self,
target: OutputTarget
) -> Result<LoggerBuilder, SetTargetError>
pub fn with_output_target( self, target: OutputTarget ) -> Result<LoggerBuilder, SetTargetError>
Explicitly set the output target for the logger. This is normally set using the NIH_LOG
environment variable. Returns an error if the target could not be set.
Trait Implementations§
§impl Debug for LoggerBuilder
impl Debug for LoggerBuilder
§impl From<SetTargetError> for LoggerBuilder
impl From<SetTargetError> for LoggerBuilder
§fn from(value: SetTargetError) -> LoggerBuilder
fn from(value: SetTargetError) -> LoggerBuilder
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for LoggerBuilder
impl Send for LoggerBuilder
impl Sync for LoggerBuilder
impl Unpin for LoggerBuilder
impl UnwindSafe for LoggerBuilder
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