feat(core): add logging for panics

This commit is contained in:
Federico Terzi 2021-05-16 16:26:03 +02:00
parent 8b73a41439
commit e08bf2f69a
3 changed files with 15 additions and 1 deletions

10
Cargo.lock generated
View File

@ -314,6 +314,7 @@ dependencies = [
"html2text", "html2text",
"lazy_static", "lazy_static",
"log", "log",
"log-panics",
"maplit", "maplit",
"markdown", "markdown",
"serde", "serde",
@ -627,6 +628,15 @@ dependencies = [
"cfg-if", "cfg-if",
] ]
[[package]]
name = "log-panics"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae0136257df209261daa18d6c16394757c63e032e27aafd8b07788b051082bef"
dependencies = [
"log",
]
[[package]] [[package]]
name = "mac" name = "mac"
version = "0.1.1" version = "0.1.1"

View File

@ -37,3 +37,4 @@ serde = { version = "1.0.123", features = ["derive"] }
serde_json = "1.0.62" serde_json = "1.0.62"
markdown = "0.3.0" markdown = "0.3.0"
html2text = "0.2.1" html2text = "0.2.1"
log-panics = "2.0.0"

View File

@ -263,6 +263,9 @@ fn main() {
WriteLogger::new(LevelFilter::Info, config, log_proxy.clone()), WriteLogger::new(LevelFilter::Info, config, log_proxy.clone()),
]) ])
.expect("unable to initialize logs"); .expect("unable to initialize logs");
// Activate logging for panics
log_panics::init();
} }
let mut cli_args: CliModuleArgs = CliModuleArgs::default(); let mut cli_args: CliModuleArgs = CliModuleArgs::default();