Skip to content

Commit

Permalink
remove tracing dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
gerdreiss committed Oct 25, 2021
1 parent 9ff14a5 commit 1718a67
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
2 changes: 0 additions & 2 deletions api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ thiserror = "1.0.30"
url = "2.2.2"
urlencoding = "2.1.0"
alphanumeric-sort = "1.4.3"
tracing = "0.1.29"
tracing-subscriber = "0.2.25"
2 changes: 0 additions & 2 deletions ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ edition = "2021"
api = { path = "../api" }
eframe = "0.14.0"
image = "0.23.14"
tracing = "0.1.29"
tracing-subscriber = "0.2.25"
16 changes: 7 additions & 9 deletions ui/src/candidates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,10 @@ impl SdkmanApp {
}
Err(e) => {
*selected_candidate = None;
let msg = format!(
"Loading all versions for candidate '{}' failed",
candidate.name
);
tracing::error!("{}:\n{}", msg, e)
println!(
"Loading all versions for candidate '{}' failed with {}",
candidate.name, e
)
}
}
}
Expand Down Expand Up @@ -419,11 +418,10 @@ impl SdkmanApp {
}
Err(e) => {
*selected_candidate = None;
let msg = format!(
"Loading all versions for candidate '{}' failed",
candidate_search_term
println!(
"Loading all versions for candidate '{}' failed with {}",
candidate_search_term, e
);
tracing::error!("{}:\n{}", msg, e)
}
}
*candidate_search_dialog = false;
Expand Down
13 changes: 6 additions & 7 deletions ui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,24 @@ fn main() {
} else if env::var("SDKMAN_DIR").is_err() {
println!("sdkman is not installed!")
} else {
tracing_subscriber::fmt::init();

let remote_candidates_handle = thread::spawn(|| match fetch_remote_candidates() {
Ok(candidates) => {
tracing::info!("Fetched {} candidates from server", candidates.len());
println!("Fetched {} candidates from server", candidates.len());
candidates
}
Err(e) => {
tracing::error!("Failed to retrieve remote candidates: {}", e);
println!("Failed to retrieve remote candidates: {}", e);
Vec::new()
}
});
let local_candidates_handle = thread::spawn(|| match retrieve_local_candidates() {
Ok(candidates) => {
tracing::info!("Found {} locally installed candidates.", candidates.len());
println!("Found {} locally installed candidates.", candidates.len());
candidates
}
Err(e) => {
tracing::error!("Failed to retrieve local candidates: {}", e);
println!("Failed to retrieve local candidates: {}", e);
Vec::new()
}
});
Expand All @@ -80,10 +79,10 @@ fn main() {
run_native(Box::new(app), win_option);
}
(Err(_), _) => {
tracing::error!("Remote candidates retrieval thread failed.");
println!("Remote candidates retrieval thread failed.");
}
(_, Err(_)) => {
tracing::error!("Local candidates retrieval thread failed.");
println!("Local candidates retrieval thread failed.");
}
}
}
Expand Down

0 comments on commit 1718a67

Please sign in to comment.