chore: refactor generic web server code into quark
This commit is contained in:
@@ -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")
|
||||
));
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user