diff --git a/Cargo.lock b/Cargo.lock index 25ec19dc..b24632f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1036,6 +1036,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a94d21414c1f4a51209ad204c1776a3d0765002c76c6abcb602a6f09f1e881c7" +[[package]] +name = "log-panics" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f9dd8546191c1850ecf67d22f5ff00a935b890d0e84713159a55495cc2ac5f" +dependencies = [ + "backtrace", + "log", +] + [[package]] name = "log4rs" version = "1.2.0" @@ -1399,6 +1409,7 @@ dependencies = [ "interlink", "local-ip-address", "log", + "log-panics", "log4rs", "reqwest", "ring", diff --git a/Cargo.toml b/Cargo.toml index 3e0f6df4..0bdb4766 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,7 @@ serde_json = "1" # Logging facade log = { version = "0.4", features = ["serde"] } +log-panics = { version = "2", features = ["with-backtrace"] } # Blaze packet system & SSLv3 async impl blaze-pk = "1.3" diff --git a/src/utils/logging.rs b/src/utils/logging.rs index f6f07d36..dd193fc2 100644 --- a/src/utils/logging.rs +++ b/src/utils/logging.rs @@ -51,6 +51,9 @@ pub fn setup(logging_level: LevelFilter) { .expect("Failed to create logging config"); init_config(config).expect("Unable to initialize logger"); + + // Include panics in logging + log_panics::init(); } /// Prints a list of possible urls that can be used to connect to