Expand description
pw_log backend that calls libc’s printf to emit log messages. This
module is useful when you have a mixed C/C++ and Rust code base and want a
simple logging system that leverages an existing printf implementation.
Note: This uses FFI to call printf. This has two implications:
- C/C++ macro processing is not done. If a system’s
printfrelies on macros, this backend will likely need to be forked to make work. - FFI calls use
unsafe. Attempts are made to useprintfin sound ways such as bounding the length of strings explicitly but this is still an off-ramp from Rust’s safety guarantees.
Varargs marshaling for call to printf is handled through a type expansion
of a series of traits. It is documented in the varargs module.
TODO: <pwbug.dev/311232605> - Document how to configure facade backends.
Modules§
- varargs
- Infrastructure for building calls to
printf.
Macros§
- pw_
log_ backend - Implements the
pw_logbackend api. - pw_
logf_ backend - Implements the
pw_logbackend api.