pub struct Logger3164 { /* private fields */ }Expand description
Logger struct for the RFC 3164 BSD syslog protocol.
Implementations§
Source§impl Logger3164
impl Logger3164
Sourcepub fn new(logger: Logger<LoggerBackend, Formatter3164>) -> Self
pub fn new(logger: Logger<LoggerBackend, Formatter3164>) -> Self
Examples found in repository?
examples/log.rs (line 18)
9fn main() {
10 let formatter = Formatter3164 {
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("could not connect to syslog");
18 log::set_boxed_logger(Box::new(Logger3164::new(logger)))
19 .map(|()| log::set_max_level(LevelFilter::Info))
20 .expect("could not register logger");
21
22 info!("hello world");
23}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Logger3164
impl RefUnwindSafe for Logger3164
impl Send for Logger3164
impl Sync for Logger3164
impl Unpin for Logger3164
impl UnsafeUnpin for Logger3164
impl UnwindSafe for Logger3164
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