11 ms·
Are there libraries like this, but in rust? As far as I understand, it relies on C's preprocessor, so it is impossible to create bindings for another language.
by username81 2y ago
Are there libraries like this, but in rust? As far as I understand, it relies on C's preprocessor, so it is impossible to create bindings for another language.
- cmptrnerd6 2y agoI have not used this and it says it targets embedded systems but maybe it is close enough to what you might be looking for: https://github.com/knurling-rs/defmt https://github.com/knurling-rs/defmt
- steveklabnik 2y agoI have used this, but not the library in the link. From the link’s README, they’re at least analogous. While maybe not the exact same thing, they’re at least the same idea.
- deleted 2y ago[deleted]
- eventhelix 2y agoStallone is another option for Rust: https://github.com/GaloisInc/balboa/blob/main/stallone/log/src/lib.rs https://github.com/GaloisInc/balboa/blob/main/stallone/log/s...
- andrepd 2y agoSounds like something that would be doable in rust. I'm not sure how you would go about building the compile-time table of log locations and format strings, sounds like the hardest part.
- wtetzner 2y ago> I'm not sure how you would go about building the compile-time table of log locations and format strings, sounds like the hardest part. Sounds like a job for a macro.
- steveklabnik 2y agoYep. And macros for logging are already the norm in Rust.