pub struct LogOutput { /* private fields */ }Expand description
A log output to be included in the log_outputs parameter of VeilidLog::try_init
Example: (debug logs to the terminal, and informational logs to the api tracing layer)
let log_outputs = [
LogOutput::stdout(true).with_common_log_level(VeilidConfigLogLevel::Debug),
LogOutput::api().with_common_log_level(VeilidConfigLogLevel::Info)
];Example: (no logs to the terminal)
let log_outputs = [LogOutput::stdout(true)];
let logs = VeilidTracing::try_init(log_outputs).expect("logs failed to initialize");
// ...
logs.try_apply_facility_level("#common", VeilidConfigLogLevel::Debug).expect("should set log level");Implementations§
Source§impl LogOutput
impl LogOutput
Sourcepub fn file<P: AsRef<Path>>(path: P, append: bool) -> Self
pub fn file<P: AsRef<Path>>(path: P, append: bool) -> Self
Creates a log writing to a file on disk
Sourcepub fn layer<L>(
name: String,
layer: Box<dyn Layer<Registry> + Send + Sync + 'static>,
) -> Self
pub fn layer<L>( name: String, layer: Box<dyn Layer<Registry> + Send + Sync + 'static>, ) -> Self
Creates a log that accepts an arbitrary tracing layer
Sourcepub fn with_common_log_level(self, level: VeilidConfigLogLevel) -> Self
pub fn with_common_log_level(self, level: VeilidConfigLogLevel) -> Self
Convenience function that applies a default log level to the ‘veilid::common’ Veilid log tags
Sourcepub fn try_with_directives<C: TryIntoIterVeilidLogDirective>(
self,
directives: C,
) -> VeilidAPIResult<Self>
pub fn try_with_directives<C: TryIntoIterVeilidLogDirective>( self, directives: C, ) -> VeilidAPIResult<Self>
Change which log facilities are enabled by default on this log output. This can also be changed after the VeilidLog is initialized.
Auto Trait Implementations§
impl Freeze for LogOutput
impl !RefUnwindSafe for LogOutput
impl Send for LogOutput
impl Sync for LogOutput
impl Unpin for LogOutput
impl !UnwindSafe for LogOutput
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more