This document explains how to use rust syslogger library.
"//garnet/public/rust/fuchsia-syslog"
Logger can only be initialized once.
#[macro_use] extern crate fuchsia_syslog as syslog; fn main() { syslog::init().expect("should not fail"); }
#[macro_use] extern crate fuchsia_syslog as syslog; fn main() { syslog::init_with_tags(&["my_tags"]).expect("should not fail"); }
fx_log_info!("my msg: {}", 10); fx_log_info!(tag: "tag", "my msg: {}", 10); fx_log_err!("my msg: {}", 10); fx_log_err!(tag: "tag", "my msg: {}", 10); fx_log_warn!("my msg: {}", 10); fx_log_warn!(tag: "tag", "my msg: {}", 10); fx_vlog!(1, "my msg: {}", 10); // verbose logs fx_vlog!(tag: "tag", 1, "my msg: {}", 10); // verbose logs
This can also be used with rust log crate
info!("my msg: {}", 10); warn!("my msg: {}", 10); error!("my msg: {}", 10);