pub trait DynSyslog: Send + Sync {
// Required methods
fn connectlog(&self) -> SyRes<()>;
fn setlogmask(&self, logmask: i32) -> SyRes<i32>;
fn closelog(&self) -> SyRes<()>;
fn syslog(&self, pri: Priority, fmt: String) -> SyRes<()>;
fn change_identity(&self, ident: Option<&str>) -> SyRes<()>;
fn reconnect(&self) -> SyRes<()>;
}Expand description
A public trait which defines the public interface for the dyn syslog instance.
Required Methods§
Sourcefn connectlog(&self) -> SyRes<()>
fn connectlog(&self) -> SyRes<()>
Connects the current instance to the syslog server (destination).
Sourcefn setlogmask(&self, logmask: i32) -> SyRes<i32>
fn setlogmask(&self, logmask: i32) -> SyRes<i32>
Sets the logmask to filter out the syslog calls.
See macroses [LOG_MASK] and [LOG_UPTO] to generate mask
§Example
LOG_MASK!(Priority::LOG_EMERG) | LOG_MASK!(Priority::LOG_ERROR)
or
~(LOG_MASK!(Priority::LOG_INFO)) LOG_UPTO!(Priority::LOG_ERROR)
Sourcefn change_identity(&self, ident: Option<&str>) -> SyRes<()>
fn change_identity(&self, ident: Option<&str>) -> SyRes<()>
This function can be used to update the facility name, for example after fork().
§Arguments
ident- an Option optional new identity (up to 48 UTF8 chars) If set to Option::None would request the program name from OS.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".