pub enum FacadeVariant {
None,
StdOut,
StdErr,
Syslog(String),
File(PathBuf, bool),
}
Expand description
Declaration of the different available log facacdes (log targets).
§Errors
When parsing a FacadeVariant
from a string, the following errors can occur:
- If the string does not match any of the known variants, a
String
is returned with an error message. - If the string matches a known variant but the variant is not implemented, a
String
is returned with an error message.
§Panics
There are some known panics that can occur when initializing or logging to a facade.
§Panic on initialization
The Syslog
variant will panic if the given facility is not a valid
syslog facility.
The File
variant will panic if the given filename is not a valid path
or opening the file fails.
§Panic on logging
Variants§
None
Logging is disabled
StdOut
Log to stdout
Note: This bypasses the OutputCapture of std::io::stdout
StdErr
Log to stderr
Note: This bypasses the OutputCapture of std::io::stderr
Syslog(String)
Log to syslog
The first argument is the syslog facility (e.g. “user”)
File(PathBuf, bool)
Log to a file
The first argument is the filename The second argument is a boolean that indicates whether the file should be truncated
Trait Implementations§
Source§impl Clone for FacadeVariant
impl Clone for FacadeVariant
Source§fn clone(&self) -> FacadeVariant
fn clone(&self) -> FacadeVariant
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more