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" {
|
if request.url.scheme() == "dioxus" {
|
||||||
match dioxus_asset_resolver::native::serve_asset(request.url.path()) {
|
match dioxus_asset_resolver::native::serve_asset(request.url.path()) {
|
||||||
Ok(res) => {
|
Ok(res) => {
|
||||||
|
#[cfg(feature = "tracing")]
|
||||||
tracing::trace!("fetching asset from file system success {request:#?}");
|
tracing::trace!("fetching asset from file system success {request:#?}");
|
||||||
handler.bytes(doc_id, res.into_body().into(), self.callback.clone())
|
handler.bytes(doc_id, res.into_body().into(), self.callback.clone())
|
||||||
}
|
}
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
|
#[cfg(feature = "tracing")]
|
||||||
tracing::warn!("fetching asset from file system error {request:#?}");
|
tracing::warn!("fetching asset from file system error {request:#?}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ impl DioxusNativeApplication {
|
|||||||
|
|
||||||
impl ApplicationHandler<BlitzShellEvent> for DioxusNativeApplication {
|
impl ApplicationHandler<BlitzShellEvent> for DioxusNativeApplication {
|
||||||
fn resumed(&mut self, event_loop: &ActiveEventLoop) {
|
fn resumed(&mut self, event_loop: &ActiveEventLoop) {
|
||||||
|
#[cfg(feature = "tracing")]
|
||||||
tracing::debug!("Injecting document provider into all windows");
|
tracing::debug!("Injecting document provider into all windows");
|
||||||
|
|
||||||
if let Some(config) = self.pending_window.take() {
|
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>();
|
let event_loop = create_default_event_loop::<BlitzShellEvent>();
|
||||||
|
|
||||||
// Turn on the runtime and enter it
|
// Turn on the runtime and enter it
|
||||||
|
#[cfg(feature = "net")]
|
||||||
let rt = tokio::runtime::Builder::new_multi_thread()
|
let rt = tokio::runtime::Builder::new_multi_thread()
|
||||||
.enable_all()
|
.enable_all()
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
#[cfg(feature = "net")]
|
||||||
let _guard = rt.enter();
|
let _guard = rt.enter();
|
||||||
|
|
||||||
// Setup hot-reloading if enabled.
|
// Setup hot-reloading if enabled.
|
||||||
|
|||||||
Reference in new issue
Block a user