LOGZ

This repo provides a crate with a Rust Logger implementation for use on an embedded device with Zephyr RTOS. bindgen and cbindgen are used to bind Rust calls to Zephyr RTOS's log2 implementation

Build

Include this crate in another crate that needs a logger implementation and make the usual log macro calls like log::trace!("2.0 * 2.0 = {}", 2. * 2.);. With a high initialization priority, the global logger is initialized to call the matching LOGDBG, LOGINF, LOGWRN, or LOGERR macro in the bridging C.

Build Tools

In order to build there are several tools to install

If you have all of that, then cargo make test should work.

Example

In the example, we have a blinky application compiled for NRF52 or NRF53. The CMakeLists.txt of the sample project adds logz as a static library, exposes the headers to sample app, and runs the build with cargo whenever you build.