chore: refactor generic web server code into quark

This commit is contained in:
Paul Makles
2022-06-04 19:02:10 +01:00
parent 7390b3c087
commit d660127c14
38 changed files with 170 additions and 170 deletions

View File

@@ -1,5 +1,5 @@
/// Configure logging and common Rust variables
pub fn setup_logging() -> sentry::ClientInitGuard {
pub fn setup_logging(release: &'static str) -> sentry::ClientInitGuard {
dotenv::dotenv().ok();
if std::env::var("RUST_LOG").is_err() {
@@ -11,12 +11,24 @@ pub fn setup_logging() -> sentry::ClientInitGuard {
}
pretty_env_logger::init();
info!("Starting {release}");
sentry::init((
"https://62fd0e02c5354905b4e286757f4beb16@sentry.insert.moe/4",
sentry::ClientOptions {
release: sentry::release_name!(),
release: Some(release.into()),
..Default::default()
},
))
}
#[macro_export]
macro_rules! configure {
() => {
let _sentry = revolt_quark::util::log::setup_logging(concat!(
env!("CARGO_PKG_NAME"),
"@",
env!("CARGO_PKG_VERSION")
));
};
}