Struct syslog::BasicLogger
source · pub struct BasicLogger { /* private fields */ }
Implementations§
source§impl BasicLogger
impl BasicLogger
sourcepub fn new(logger: Logger<LoggerBackend, Formatter3164>) -> BasicLogger
pub fn new(logger: Logger<LoggerBackend, Formatter3164>) -> BasicLogger
Examples found in repository?
examples/log.rs (line 18)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
fn main() {
let formatter = Formatter3164 {
facility: Facility::LOG_USER,
hostname: None,
process: "myprogram".into(),
pid: 0,
};
let logger = syslog::unix(formatter).expect("could not connect to syslog");
log::set_boxed_logger(Box::new(BasicLogger::new(logger)))
.map(|()| log::set_max_level(LevelFilter::Info))
.expect("could not register logger");
info!("hello world");
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BasicLogger
impl RefUnwindSafe for BasicLogger
impl Send for BasicLogger
impl Sync for BasicLogger
impl Unpin for BasicLogger
impl UnwindSafe for BasicLogger
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