switch to tracing for logging
This commit is contained in:
1 parent
c8127e164b
commit
c55c17cb81
50 files changed
+95
-78
No files matched your search
@@ -10,7 +10,7 @@ pub(crate) fn serde_from_bytes<T: DeserializeOwned>(string: &[u8]) -> Option<T>
|
||||
let decompressed = match STANDARD.decode(string) {
|
||||
Ok(bytes) => bytes,
|
||||
Err(err) => {
|
||||
log::error!("Failed to decode base64: {}", err);
|
||||
tracing::error!("Failed to decode base64: {}", err);
|
||||
return None;
|
||||
}
|
||||
};
|
||||
@@ -18,7 +18,7 @@ pub(crate) fn serde_from_bytes<T: DeserializeOwned>(string: &[u8]) -> Option<T>
|
||||
match postcard::from_bytes(&decompressed) {
|
||||
Ok(data) => Some(data),
|
||||
Err(err) => {
|
||||
log::error!("Failed to deserialize: {}", err);
|
||||
tracing::error!("Failed to deserialize: {}", err);
|
||||
None
|
||||
}
|
||||
}
|
||||
@@ -32,14 +32,14 @@ static SERVER_DATA: once_cell::sync::Lazy<Option<HTMLDataCursor>> =
|
||||
let element = match window.get_element_by_id("dioxus-storage-data") {
|
||||
Some(element) => element,
|
||||
None => {
|
||||
log::error!("Failed to get element by id: dioxus-storage-data");
|
||||
tracing::error!("Failed to get element by id: dioxus-storage-data");
|
||||
return None;
|
||||
}
|
||||
};
|
||||
let attribute = match element.get_attribute("data-serialized") {
|
||||
Some(attribute) => attribute,
|
||||
None => {
|
||||
log::error!("Failed to get attribute: data-serialized");
|
||||
tracing::error!("Failed to get attribute: data-serialized");
|
||||
return None;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ impl HTMLDataCursor {
|
||||
pub fn take<T: DeserializeOwned>(&self) -> Option<T> {
|
||||
let current = self.index.load(std::sync::atomic::Ordering::SeqCst);
|
||||
if current >= self.data.len() {
|
||||
log::error!(
|
||||
tracing::error!(
|
||||
"Tried to take more data than was available, len: {}, index: {}",
|
||||
self.data.len(),
|
||||
current
|
||||
@@ -48,7 +48,7 @@ impl HTMLDataCursor {
|
||||
match postcard::from_bytes(cursor) {
|
||||
Ok(x) => Some(x),
|
||||
Err(e) => {
|
||||
log::error!("Error deserializing data: {:?}", e);
|
||||
tracing::error!("Error deserializing data: {:?}", e);
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user