MCPcopy Create free account
hub / github.com/Moosync/Moosync / main

Function main

src/main.rs:36–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35#[tracing::instrument(level = "debug", skip())]
36fn main() {
37 console_error_panic_hook::set_once();
38
39 let filter = window().get("LOGGING_FILTER");
40 let filter = if let Some(filter) = filter {
41 filter.as_string().unwrap()
42 } else {
43 "error".into()
44 };
45
46 let filter = tracing_subscriber::filter::EnvFilter::try_new(filter).unwrap_or_default();
47 let log_layer = fmt::layer()
48 .pretty()
49 .with_target(true)
50 .without_time()
51 .with_ansi(false)
52 .with_writer(MakeConsoleWriter::default());
53
54 let layer = fmt::layer()
55 .pretty()
56 .with_target(true)
57 .with_ansi(true)
58 .without_time()
59 .with_writer(MakeConsoleWriter::new_log_file());
60
61 let subscriber = tracing_subscriber::registry()
62 .with(layer)
63 .with(log_layer)
64 .with(filter);
65 tracing::subscriber::set_global_default(subscriber).unwrap();
66
67 mount_to_body(|| {
68 view! {
69 <I18nContextProvider>
70 <App />
71 </I18nContextProvider>
72 }
73 })
74}

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected