Struct syslog_rs::a_sync::syslog_async::Syslog
source · pub struct Syslog { /* private fields */ }Expand description
A common instance which describes the syslog state
Trait Implementations§
source§impl SyslogExt for Syslog
impl SyslogExt for Syslog
source§fn openlog_custom<'life0, 'async_trait, P>(
ident: Option<&'life0 str>,
logstat: LogStat,
facility: LogFacility,
sock_path: P
) -> Pin<Box<dyn Future<Output = SyRes<Self>> + Send + 'async_trait>>where
P: AsRef<Path> + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
fn openlog_custom<'life0, 'async_trait, P>(
ident: Option<&'life0 str>,
logstat: LogStat,
facility: LogFacility,
sock_path: P
) -> Pin<Box<dyn Future<Output = SyRes<Self>> + Send + 'async_trait>>where
P: AsRef<Path> + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
source§fn change_identity<'life0, 'async_trait, I>(
&'life0 self,
ident: I
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
I: 'async_trait + AsRef<str> + Send,
Self: 'async_trait,
'life0: 'async_trait,
fn change_identity<'life0, 'async_trait, I>(
&'life0 self,
ident: I
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
I: 'async_trait + AsRef<str> + Send,
Self: 'async_trait,
'life0: 'async_trait,
This function can be used to update the facility name, for example after fork().
Arguments
ident- a new identity (up to 48 UTF8 chars)
source§impl SyslogStd for Syslog
impl SyslogStd for Syslog
source§fn openlog<'life0, 'async_trait>(
ident: Option<&'life0 str>,
logstat: LogStat,
facility: LogFacility
) -> Pin<Box<dyn Future<Output = SyRes<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn openlog<'life0, 'async_trait>(
ident: Option<&'life0 str>,
logstat: LogStat,
facility: LogFacility
) -> Pin<Box<dyn Future<Output = SyRes<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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);source§fn setlogmask<'life0, 'async_trait>(
&'life0 self,
logmask: i32
) -> Pin<Box<dyn Future<Output = i32> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn setlogmask<'life0, 'async_trait>(
&'life0 self,
logmask: i32
) -> Pin<Box<dyn Future<Output = i32> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
source§fn closelog<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn closelog<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Similar to libc, closelog() will close the log