(cherry picked from commit 78089941ff
)
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
This commit is contained in:
@ -431,7 +431,7 @@ pub fn flush() {
|
||||
}
|
||||
|
||||
/// Hook the panic handler to generate a data point on each panic
|
||||
pub fn set_panic_hook(program: &'static str) {
|
||||
pub fn set_panic_hook(program: &'static str, version: Option<String>) {
|
||||
static SET_HOOK: Once = Once::new();
|
||||
SET_HOOK.call_once(|| {
|
||||
let default_hook = std::panic::take_hook();
|
||||
@ -450,6 +450,7 @@ pub fn set_panic_hook(program: &'static str) {
|
||||
.add_field_i64("one", 1)
|
||||
.add_field_str("message", &ono.to_string())
|
||||
.add_field_str("location", &location)
|
||||
.add_field_str("version", version.as_ref().unwrap_or(&"".to_string()))
|
||||
.to_owned(),
|
||||
Level::Error,
|
||||
);
|
||||
|
Reference in New Issue
Block a user