fix: feature gate tokio and tracing (#4651)
Signed-off-by: Omar Mohamed <mohamed.omar67492@gmail.com>
This commit is contained in:
1 parent
284d6ea68e
commit
a9ef9af980
3 files changed
+5
No files matched your search
@@ -35,10 +35,12 @@ impl NetProvider<Resource> for DioxusNativeNetProvider {
|
||||
if request.url.scheme() == "dioxus" {
|
||||
match dioxus_asset_resolver::native::serve_asset(request.url.path()) {
|
||||
Ok(res) => {
|
||||
#[cfg(feature = "tracing")]
|
||||
tracing::trace!("fetching asset from file system success {request:#?}");
|
||||
handler.bytes(doc_id, res.into_body().into(), self.callback.clone())
|
||||
}
|
||||
Err(_) => {
|
||||
#[cfg(feature = "tracing")]
|
||||
tracing::warn!("fetching asset from file system error {request:#?}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,6 +111,7 @@ impl DioxusNativeApplication {
|
||||
|
||||
impl ApplicationHandler<BlitzShellEvent> for DioxusNativeApplication {
|
||||
fn resumed(&mut self, event_loop: &ActiveEventLoop) {
|
||||
#[cfg(feature = "tracing")]
|
||||
tracing::debug!("Injecting document provider into all windows");
|
||||
|
||||
if let Some(config) = self.pending_window.take() {
|
||||
|
||||
@@ -82,10 +82,12 @@ pub fn launch_cfg_with_props<P: Clone + 'static, M: 'static>(
|
||||
let event_loop = create_default_event_loop::<BlitzShellEvent>();
|
||||
|
||||
// Turn on the runtime and enter it
|
||||
#[cfg(feature = "net")]
|
||||
let rt = tokio::runtime::Builder::new_multi_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
.unwrap();
|
||||
#[cfg(feature = "net")]
|
||||
let _guard = rt.enter();
|
||||
|
||||
// Setup hot-reloading if enabled.
|
||||
|
||||
Reference in new issue
Block a user