pub struct VeilidLogDirective { /* private fields */ }Expand description
Changes to the VeilidLayerFilter enabled facilities
Veilid log facilities are string names that can refer to two things:
- The name of a tracing log target
- A tag name which represents a group of tracing log targets
Tags are used to group commonly used log facilities that can all be turned on and off together for ease of debugging.
Veilid log directives are instructions to set a facility to a visibility level in the log output.
The format is an extension of the RUST_LOG / EnvFilter format.
- enable:
facility=levelto enable ‘facility’ with a max level, where level is one oferror,warn,info,debug, ortrace - disable:
facility=offto disable ‘facility’ in the logs - default:
facility=defaultto remove the facility from the filter and use whatever defaults exist - reset:
leveloroffby itself removes all logs facility customizations and resets the base log level for -all- targets including external crates. If you change this level you will turn on or off every log target in the system. - reset default:
defaultby itself sets the logs to the application-specific default log string, which is customizable on theVeilidTracingorVeilidLayerFilterstructs. By default the ‘default’ is all logs turned off.
Log facilities can be combined with a comma, like this:
RUST_LOG="common=info,rpc_message=debug"
Log facility names must follow these validity rules:
- log facility name can not be empty
- first character of log facility name must be ASCII alphanumeric or ‘-’
- characters of log facility name must be ASCII alphanumeric or one of ‘-_:’
- log facility tags follows the same rules as facility names but must start with ‘#’
Some of the defined log tags include:
#veilid- All of the veilid log targets#common- The most commonly useful veilid log targets#enabled- The set of currently enabled#veilidlog targets (those notVeilidConfigLogLevel::Off)
Implementations§
Source§impl VeilidLogDirective
impl VeilidLogDirective
Sourcepub fn try_facility_level<S: AsRef<str>>(
facility: S,
opt_level: Option<VeilidConfigLogLevel>,
) -> VeilidAPIResult<Self>
pub fn try_facility_level<S: AsRef<str>>( facility: S, opt_level: Option<VeilidConfigLogLevel>, ) -> VeilidAPIResult<Self>
Set a specific facility or tag to log level
Sourcepub fn global_level(opt_level: Option<VeilidConfigLogLevel>) -> Self
pub fn global_level(opt_level: Option<VeilidConfigLogLevel>) -> Self
Clear all log facility mappings and reset the global log facility level to a specific log level or the default levels if None is specified.
Trait Implementations§
Source§impl Clone for VeilidLogDirective
impl Clone for VeilidLogDirective
Source§fn clone(&self) -> VeilidLogDirective
fn clone(&self) -> VeilidLogDirective
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VeilidLogDirective
impl Debug for VeilidLogDirective
Source§impl<'de> Deserialize<'de> for VeilidLogDirective
impl<'de> Deserialize<'de> for VeilidLogDirective
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for VeilidLogDirective
impl Display for VeilidLogDirective
Source§impl FromStr for VeilidLogDirective
impl FromStr for VeilidLogDirective
Source§impl IntoIterator for VeilidLogDirective
impl IntoIterator for VeilidLogDirective
Source§impl Serialize for VeilidLogDirective
impl Serialize for VeilidLogDirective
Source§impl TryFrom<&String> for VeilidLogDirective
impl TryFrom<&String> for VeilidLogDirective
Source§impl TryFrom<&str> for VeilidLogDirective
impl TryFrom<&str> for VeilidLogDirective
Auto Trait Implementations§
impl Freeze for VeilidLogDirective
impl RefUnwindSafe for VeilidLogDirective
impl Send for VeilidLogDirective
impl Sync for VeilidLogDirective
impl Unpin for VeilidLogDirective
impl UnwindSafe for VeilidLogDirective
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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