Skip to content

Commit

Permalink
chore(cleanup): remove some debug log leftovers (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrzlgnm authored Apr 30, 2024
1 parent 8237c13 commit 9c9357b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
6 changes: 1 addition & 5 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn resolve_service(service_type: String, state: State<MdnsState>) -> Vec<Resolve
if service_type.is_empty() {
return vec![];
}
log::info!("Resolving {}", service_type);
log::debug!("Resolving {}", service_type);
let mdns = state.shared.lock().unwrap();
let mut service_type = service_type;
if !service_type.ends_with(".local.") {
Expand Down Expand Up @@ -201,10 +201,6 @@ fn enum_service_types(state: State<MdnsState>) -> Vec<String> {
_ => {}
}
}
let mr = mdns.get_metrics().expect("Failed to get metrics");
if let Ok(metrics) = mr.recv() {
log::debug!("Metrics {:#?}", metrics);
}
found.sort();
log::debug!("Found service types: {:?}", found);
}
Expand Down
12 changes: 6 additions & 6 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fn ShowResolvedServices(services: ResolvedServices) -> impl IntoView {
#[component]
fn ResolveService() -> impl IntoView {
let interfaces = create_rw_signal(HashSet::<String>::new());
let itfs = create_resource(
let itfs_res = create_resource(
move || interfaces,
|_| async move { get_interfaces().await },
);
Expand All @@ -150,15 +150,15 @@ fn ResolveService() -> impl IntoView {
async move { set_interfaces(itfs).await }
});
let service_type = create_rw_signal(String::new());
let stys = create_resource(|| (), |_| async move { enum_service_types().await });
let service_type_res = create_resource(|| (), |_| async move { enum_service_types().await });

create_effect(move |_| {
log::debug!("Setting interfaces: {:#?}", interfaces.get());
set_interfaces_action.dispatch(interfaces.get());
});

let options = create_memo(move |_| match stys.get() {
Some(stys) => stys
let service_type_options = create_memo(move |_| match service_type_res.get() {
Some(service_types) => service_types
.into_iter()
.map(|service_type| AutoCompleteOption {
label: service_type.clone(),
Expand Down Expand Up @@ -187,12 +187,12 @@ fn ResolveService() -> impl IntoView {
<Layout style="padding: 20px;">
<Suspense fallback=move || view! {<Space><Text>"Loading..."</Text></Space>}>
<Space>
<AutoComplete value=service_type options=options placeholder="Service type"/>
<AutoComplete value=service_type options=service_type_options placeholder="Service type"/>
<Button on_click>"Resolve"</Button>
<CheckboxGroup value=interfaces>
<For
each=move|| {
let itfs = itfs.get().unwrap_or_else(|| vec![String::from("None")]);
let itfs = itfs_res.get().unwrap_or_else(|| vec![String::from("None")]);
let mut sm = HashSet::new();
sm.extend(itfs.clone());
interfaces.set(sm);
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use app::*;
use leptos::*;

fn main() {
_ = console_log::init_with_level(log::Level::Debug);
_ = console_log::init_with_level(log::Level::Info);
console_error_panic_hook::set_once();
mount_to_body(|| {
view! { <App/> }
Expand Down

0 comments on commit 9c9357b

Please sign in to comment.