pub struct LogConfig {
pub log_target: LogTarget,
pub log_file: ConfigPath,
pub log_facility: LogFacility,
pub log_level: LogFilter,
}
Expand description
Logging configuration.
Fields
log_target: LogTarget
Where to log to?
log_file: ConfigPath
If logging to a file, use this file.
This isn’t part of log_target
for deserialization reasons.
log_facility: LogFacility
The syslog facility when logging to syslog.
This isn’t part of log_target
for deserialization reasons.
log_level: LogFilter
The minimum log level to actually log.
Implementations
sourceimpl LogConfig
impl LogConfig
sourcepub fn config_args(app: Command<'_>) -> Command<'_>
pub fn config_args(app: Command<'_>) -> Command<'_>
Configures a clap app with the options for logging.
sourcepub fn update_with_arg_matches(
&mut self,
matches: &ArgMatches,
cur_dir: &Path
) -> Result<(), Failed>
pub fn update_with_arg_matches(
&mut self,
matches: &ArgMatches,
cur_dir: &Path
) -> Result<(), Failed>
Update the logging configuration from command line arguments.
This should be called after the configuration file has been loaded.
sourcepub fn init_logging() -> Result<(), ExitError>
pub fn init_logging() -> Result<(), ExitError>
Initialize logging.
All diagnostic output of RTRTR is done via logging, never to
stderr directly. Thus, it is important to initalize logging before
doing anything else that may result in such output. This function
does exactly that. It sets a maximum log level of warn
, leading
only printing important information, and directs all logging to
stderr.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for LogConfig
impl<'de> Deserialize<'de> for LogConfig
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for LogConfig
impl Send for LogConfig
impl Sync for LogConfig
impl Unpin for LogConfig
impl UnwindSafe for LogConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more