pub struct Logger5424 { /* private fields */ }Expand description
Logger struct for the RFC 5424 syslog protocol.
Implementations§
Source§impl Logger5424
impl Logger5424
Sourcepub fn new(logger: Logger<LoggerBackend, Formatter5424>) -> Self
pub fn new(logger: Logger<LoggerBackend, Formatter5424>) -> Self
Create a new logger with the RFC5424 formatter.
Examples found in repository?
examples/rfc5424.rs (line 18)
9fn main() {
10 let formatter = Formatter5424 {
11 facility: Facility::LOG_USER,
12 hostname: None,
13 process: "myprogram".into(),
14 pid: 0,
15 };
16
17 let logger = syslog_too::unix(formatter).expect("failed to connect to syslog");
18 log::set_boxed_logger(Box::new(Logger5424::new(logger)))
19 .map(|()| log::set_max_level(log::LevelFilter::Info))
20 .expect("failed to register logger");
21
22 info!("hello world");
23}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Logger5424
impl RefUnwindSafe for Logger5424
impl Send for Logger5424
impl Sync for Logger5424
impl Unpin for Logger5424
impl UnsafeUnpin for Logger5424
impl UnwindSafe for Logger5424
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more