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

Configures a clap app with the options for logging.

Update the logging configuration from command line arguments.

This should be called after the configuration file has been loaded.

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.

Switches logging to the configured target.

Once the configuration has been successfully loaded, logging should be switched to whatever the user asked for via this method.

Trait Implementations

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more