Crates.io | xous-api-log |
lib.rs | xous-api-log |
version | 0.1.59 |
source | src |
created_at | 2022-10-02 15:23:06.661796 |
updated_at | 2024-06-26 16:27:21.377508 |
description | Log server API |
homepage | https://betrusted.io/xous-book/ |
repository | https://github.com/betrusted-io/xous-core/ |
max_upload_size | |
id | 678365 |
size | 9,321 |
API calls to access the Xous logging service. Provides glue between the log
crate, the Xous kernel and the hardware.
Every process that relies on the logging service should call xous_api_log::init_wait()
before using any log
calls.
Below is a minimal example of how to use the logging service.
fn main() -> ! {
xous_api_log::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Info);
log::info!("my PID is {}", xous::process::id());
let timeout = std::time::Duration::from_millis(1000);
let mut count = 0;
loop {
log::info!("test loop {}", count);
count += 1;
std::thread::sleep(timeout);
}
}