Struct syslog_rs::syslog_sync::Syslog [−][src]
pub struct Syslog { /* fields omitted */ }
Expand description
A common instance which describes the syslog state
Implementations
A public implementations
As in a libc, this function initializes the syslog instance. The main difference with realization in C is it returns the instance to program used this crate. This structure implements the Send and Sync so it does not require any additional synchonization.
Arguments
-
ident
- a identification of the sender. If not set, the crate will determine automatically! -
logstat
- sets up the syslog behaviour. Use LogStat -
facility
- a syslog facility. Use LogFacility
Returns
- A SyRes with instance or Err()
Example
Syslog::openlog( Some("test1"), LogStat::LOG_NDELAY | LogStat::LOG_PID, LogFacility::LOG_DAEMON);
Sets the logmask to filter out the syslog calls.
See macroses [common::LOG_MASK] and [common::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)