remove sentry

This commit is contained in:
Irevoire 2021-08-24 12:27:30 +02:00
parent 6b228f56cb
commit 672fcee8aa
No known key found for this signature in database
GPG key ID: 7A6A970C96104F1B
4 changed files with 8 additions and 260 deletions

View file

@ -78,20 +78,6 @@ whoami = { version = "1.1.2", optional = true }
reqwest = { version = "0.11.3", features = ["json", "rustls-tls"], default-features = false, optional = true }
serdeval = "0.1.0"
[dependencies.sentry]
default-features = false
features = [
"backtrace",
"contexts",
"panic",
"reqwest",
"rustls",
"log",
]
optional = true
version = "0.22.0"
[dev-dependencies]
actix-rt = "2.1.0"
assert-json-diff = { branch = "master", git = "https://github.com/qdequele/assert-json-diff" }
@ -112,7 +98,7 @@ mini-dashboard = [
"tempfile",
"zip",
]
analytics = ["sentry", "whoami", "reqwest"]
analytics = ["whoami", "reqwest"]
default = ["analytics", "mini-dashboard"]
[target.'cfg(target_os = "linux")'.dependencies]

View file

@ -14,9 +14,6 @@ use std::sync::Arc;
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
#[cfg(all(not(debug_assertions), feature = "analytics"))]
const SENTRY_DSN: &str = "https://5ddfa22b95f241198be2271aaf028653@sentry.io/3060337";
#[actix_web::main]
async fn main() -> Result<(), MainError> {
let opt = Opt::from_args();
@ -28,6 +25,8 @@ async fn main() -> Result<(), MainError> {
log_builder.filter_module("milli", log::LevelFilter::Warn);
}
log_builder.init();
match opt.env.as_ref() {
"production" => {
if opt.master_key.is_none() {
@ -36,37 +35,8 @@ async fn main() -> Result<(), MainError> {
.into(),
);
}
#[cfg(all(not(debug_assertions), feature = "analytics"))]
if !opt.no_analytics {
let logger =
sentry::integrations::log::SentryLogger::with_dest(log_builder.build());
log::set_boxed_logger(Box::new(logger))
.map(|()| log::set_max_level(log::LevelFilter::Info))
.unwrap();
let sentry = sentry::init(sentry::ClientOptions {
release: sentry::release_name!(),
dsn: Some(SENTRY_DSN.parse()?),
before_send: Some(Arc::new(|event| {
if matches!(event.message, Some(ref msg) if msg.to_lowercase().contains("no space left on device"))
{
None
} else {
Some(event)
}
})),
..Default::default()
});
// sentry must stay alive as long as possible
std::mem::forget(sentry);
} else {
log_builder.init();
}
}
"development" => {
log_builder.init();
}
"development" => (),
_ => unreachable!(),
}