[−][src]Module sys_util::syslog
Facilities for sending log message to syslog.
Every function exported by this module is thread-safe. Each function will silently fail until
syslog::init()
is called and returns Ok
.
Examples
#[macro_use] extern crate sys_util; use sys_util::syslog; fn main() { if let Err(e) = syslog::init() { println!("failed to initiailize syslog: {:?}", e); return; } warn!("this is your {} warning", "final"); error!("something went horribly wrong: {:?}", "out of RAMs"); }
Enums
Error | Errors returned by |
Facility | The facility of a syslog message. |
Priority | The priority (i.e. severity) of a syslog message. |
Functions
echo_file | Replaces the optional |
echo_stderr | Enables or disables echoing log messages to the |
echo_syslog | Enables or disables echoing log messages to the syslog. |
init | Initialize the syslog connection and internal variables. |
log | Records a log message with the given details. |
push_fds | Retrieves the file descriptors owned by the global syslogger. |
set_hostname | Replaces the hostname reported in each syslog message. |
set_proc_name | Replaces the process name reported in each syslog message. |