add sentry probe

This commit is contained in:
qdequele 2020-05-07 16:34:20 +02:00
parent 61ce9486fc
commit b62945961f
No known key found for this signature in database
GPG key ID: B3F0A000EBF11745
4 changed files with 448 additions and 1 deletions

View file

@ -19,6 +19,14 @@ static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
async fn main() -> Result<(), MainError> {
let opt = Opt::from_args();
let _sentry = sentry::init((
"https://5ddfa22b95f241198be2271aaf028653@sentry.io/3060337",
sentry::ClientOptions {
release: sentry::release_name!(),
..Default::default()
},
));
match opt.env.as_ref() {
"production" => {
if opt.master_key.is_none() {
@ -27,6 +35,10 @@ async fn main() -> Result<(), MainError> {
.into(),
);
}
if !opt.no_analytics {
sentry::integrations::panic::register_panic_handler();
sentry::integrations::env_logger::init(None, Default::default());
}
}
"development" => {
env_logger::from_env(env_logger::Env::default().default_filter_or("info")).init();