bin: extract logging setup into its own function
a little bit less messy Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -13,13 +13,7 @@ use tracing_subscriber::EnvFilter;
|
|||||||
//#[cfg(target_arch = "wasm32")]
|
//#[cfg(target_arch = "wasm32")]
|
||||||
//use wasm_bindgen::prelude::*;
|
//use wasm_bindgen::prelude::*;
|
||||||
|
|
||||||
// Desktop
|
fn setup_logging(path: &DataPath) {
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
|
||||||
#[tokio::main]
|
|
||||||
async fn main() {
|
|
||||||
let base_path = DataPath::default_base().unwrap_or(PathBuf::from_str(".").unwrap());
|
|
||||||
let path = DataPath::new(&base_path);
|
|
||||||
|
|
||||||
#[allow(unused_variables)] // need guard to live for lifetime of program
|
#[allow(unused_variables)] // need guard to live for lifetime of program
|
||||||
let (maybe_non_blocking, maybe_guard) = {
|
let (maybe_non_blocking, maybe_guard) = {
|
||||||
let log_path = path.path(DataPathType::Log);
|
let log_path = path.path(DataPathType::Log);
|
||||||
@@ -71,6 +65,16 @@ async fn main() {
|
|||||||
.with_env_filter(EnvFilter::from_default_env())
|
.with_env_filter(EnvFilter::from_default_env())
|
||||||
.init();
|
.init();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Desktop
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let base_path = DataPath::default_base().unwrap_or(PathBuf::from_str(".").unwrap());
|
||||||
|
let path = DataPath::new(&base_path);
|
||||||
|
|
||||||
|
setup_logging(&path);
|
||||||
|
|
||||||
let _res = eframe::run_native(
|
let _res = eframe::run_native(
|
||||||
"Damus NoteDeck",
|
"Damus NoteDeck",
|
||||||
|
|||||||
Reference in New Issue
Block a user