There are some issues we would run into here. The Rust std log implements:
- error
- warn
- info
- debug
- trace
All these follow the same call pattern, and do not give us a place to pass the code in error and warn. We could certainly intercept all these and pass them to our logging system with some default error code where required.
A pattern I've seen is an implemenatation of these so you get output when call them, but then application specific macros (ie: scwarn!, scerr!) where a lot more application specific context was added to meet the business requirements.
I'm not sure if looking into larger log implementations is worth it at this time as we're still best off passing to the C implementation of our logger for the forseeable future.