mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 14:50:03 -04:00
Replace tracing with log (#2928)
* Replace tracing crate with log It's just so much simpler to use * Add `bacon wasm` job * eframe: add a WebLogger for piping log events to the web console
This commit is contained in:
@@ -67,7 +67,7 @@ pub fn install_document_events(runner_container: &mut AppRunnerContainer) -> Res
|
||||
|
||||
runner_lock.input.on_web_page_focus_change(has_focus);
|
||||
runner_lock.egui_ctx().request_repaint();
|
||||
// tracing::debug!("{event_name:?}");
|
||||
// log::debug!("{event_name:?}");
|
||||
};
|
||||
|
||||
runner_container.add_event_listener(&document, event_name, closure)?;
|
||||
@@ -135,7 +135,7 @@ pub fn install_document_events(runner_container: &mut AppRunnerContainer) -> Res
|
||||
false
|
||||
};
|
||||
|
||||
// tracing::debug!(
|
||||
// log::debug!(
|
||||
// "On key-down {:?}, egui_wants_keyboard: {}, prevent_default: {}",
|
||||
// event.key().as_str(),
|
||||
// egui_wants_keyboard,
|
||||
@@ -282,7 +282,7 @@ pub fn install_canvas_events(runner_container: &mut AppRunnerContainer) -> Resul
|
||||
mut _runner_lock: egui::mutex::MutexGuard<'_, AppRunner>| {
|
||||
event.prevent_default();
|
||||
// event.stop_propagation();
|
||||
// tracing::debug!("Preventing event {event_name:?}");
|
||||
// log::debug!("Preventing event {event_name:?}");
|
||||
};
|
||||
|
||||
runner_container.add_event_listener(&canvas, event_name, closure)?;
|
||||
@@ -564,7 +564,7 @@ pub fn install_canvas_events(runner_container: &mut AppRunnerContainer) -> Resul
|
||||
let last_modified = std::time::UNIX_EPOCH
|
||||
+ std::time::Duration::from_millis(file.last_modified() as u64);
|
||||
|
||||
tracing::debug!("Loading {:?} ({} bytes)…", name, file.size());
|
||||
log::debug!("Loading {:?} ({} bytes)…", name, file.size());
|
||||
|
||||
let future = wasm_bindgen_futures::JsFuture::from(file.array_buffer());
|
||||
|
||||
@@ -573,11 +573,7 @@ pub fn install_canvas_events(runner_container: &mut AppRunnerContainer) -> Resul
|
||||
match future.await {
|
||||
Ok(array_buffer) => {
|
||||
let bytes = js_sys::Uint8Array::new(&array_buffer).to_vec();
|
||||
tracing::debug!(
|
||||
"Loaded {:?} ({} bytes).",
|
||||
name,
|
||||
bytes.len()
|
||||
);
|
||||
log::debug!("Loaded {:?} ({} bytes).", name, bytes.len());
|
||||
|
||||
// Re-lock the mutex on the other side of the await point
|
||||
let mut runner_lock = runner_ref.lock();
|
||||
@@ -592,7 +588,7 @@ pub fn install_canvas_events(runner_container: &mut AppRunnerContainer) -> Resul
|
||||
runner_lock.needs_repaint.repaint_asap();
|
||||
}
|
||||
Err(err) => {
|
||||
tracing::error!("Failed to read file: {:?}", err);
|
||||
log::error!("Failed to read file: {:?}", err);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user