Crate syslog_rs[−][src]
Expand description
syslog-rs
An implementation of the syslog from glibc/libc like it was designed in in both system libraries. The API is almost compatible with what is in libc/glibc.
Supported GNU/Linux and *BSD (incl OSX, but not guaranteed)
Files:
- syslog_sync.rs - contains the thread-safe realization of the syslog (sync). Thread safe. The Atomic and crossbeam backoff are used for sync.
- syslog_async.rs - contains the async realization of the syslog (async) Thread safe. Tokio mutex are used for sync.
- syslog_sync_queue.rs - constains the sync realization, with asynchronious processing. The internal sych of crossbeam are used to push data to queue.
- unsafe_cell.rs - a file contains a Cell which can be used to share the syslog instance. See examples.
- portable.rs - all system level code which is portable
- common.rs - a common items
- socket.rs - contains socket realization
- async_socket.rs - contains socket realization
- error.rs - an error wrapper and mapper
Features:
- feature = “use_async” for asynchronious code (use syslog_rs::sy_async::{Syslog};)
- feature = “use_sync” for synchronious code (use syslog_rs::sy_sync::{Syslog};)
- feature = “use_sync_queue” for synchronious with async processing (use syslog_rs::sy_async_queue::{Syslog};)
All features can be used simultaniously.
Usage
syslog-rs = {version = “0.1”, default-features = false, features = [“use_sync”]}
By default, use_sync
and use_async
are enabled.
Re-exports
pub use syslog_sync as sy_sync; | |
pub use syslog_async as sy_async; | |
pub use common::*; | |
pub use unsafe_cell::*; |
Modules
async_socket | |
common | |
error | |
portable | |
socket | |
syslog_async | |
syslog_sync | |
unsafe_cell |
Macros
LOG_MASK | LOG_MASK is used to create the priority mask in setlogmask. For a single Priority mask used with Priority can be used with | & ! bit operations LOG_MASK() |
LOG_UPTO | LOG_MASK is used to create the priority mask in setlogmask For a mask UPTO specified used with Priority |
map_error | |
map_error_code | |
throw_error | |
throw_error_code |