-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up logging shim #218
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks great! Just a few small things inline below. Really like how trim the dependencies have become in this PR.
rust/ccommon_rs/src/log/shim.rs
Outdated
/// | ||
/// This is meant to be | ||
pub fn set_panic_handler() { | ||
use backtrace::Backtrace; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the backtrace dependency be compatible w/ MUSL builds? Can we add x86_64-unknown-linux-musl
target to the CI to make sure? I've had problems w/ backtrace + musl historically, but looks like it might be fixed now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've redone this to use the standard lib's backtrace printing. That should (hopefully) avoid any issues around musl and the backtrace crate
22a90a6
to
7785897
Compare
7785897
to
c8ddb11
Compare
This originally tested code that was removed in #218 but was missed because the rust parts of the test are never built even when -DHAVE_RUST=1 is specified in the cmake configuration.
This PR rewrites the log shim in ccommon_rs to be both simpler and usable from the rust code. This addresses a few problems with the original log module, namely that
The new version just passes log messages through to ccommon's debug log. In addition, I've added a panic hook that logs at
LOG_CRIT
level.As a result of this, several other changes were made:
rm -rf
implementation)