pub struct SyslogBuilder { /* private fields */ }
Expand description
Builder used to create and customize the Syslog logger object.
Implementations§
Source§impl SyslogBuilder
impl SyslogBuilder
Sourcepub fn build(self) -> Syslog
pub fn build(self) -> Syslog
Consumes self
and returns a freshly created Syslog
logger object. To be called at
the end of the builder chain, after all other methods on the SyslogBuilder
object.
Sourcepub fn facility(self, facility: Facility) -> Self
pub fn facility(self, facility: Facility) -> Self
Sets logging facility to given Facility
value.
Sourcepub fn facility_raw(self, facility: c_int) -> Self
pub fn facility_raw(self, facility: c_int) -> Self
Sets logging facility to unchecked c_int
value. Can be used for
setting a raw libsyslog-sys constant directly.
Sourcepub fn ident<T: Into<Vec<u8>>>(self, ident: T) -> Result<Self, NulError>
pub fn ident<T: Into<Vec<u8>>>(self, ident: T) -> Result<Self, NulError>
Sets ident to the string like argument provided. By default ident is derived from the name of the executable.
Sourcepub fn level(self, level: LevelFilter) -> Self
pub fn level(self, level: LevelFilter) -> Self
Sets global log level to be used when no module_level rule matches.
Sourcepub fn logopt_raw(self, logopt: c_int) -> Self
pub fn logopt_raw(self, logopt: c_int) -> Self
Sets logopt to unchecked c_int
value. Can be used for setting a raw
libsyslog-sys constant directly.
Sourcepub fn module_level(self, target: &str, level: LevelFilter) -> Self
pub fn module_level(self, target: &str, level: LevelFilter) -> Self
Sets log level for specified target Rust module. Multiple calls to this method is possible and will set multiple filters. More specific filters on children will override those of their parent modules.