Anotate rust console messages

This commit is contained in:
Edward Shen 2022-01-15 23:53:25 -08:00
parent 6337642b3c
commit 0dbc5fb44e
Signed by: edward
GPG key ID: 19182661E818369F
2 changed files with 7 additions and 4 deletions

View file

@ -59,9 +59,9 @@ pub fn decrypt(
open_in_place(&mut container, key, maybe_password)?;
let mime_type = tree_magic_mini::from_u8(&container);
log!("Mime type: ", mime_type);
log!("[rs] Mime type:", mime_type);
log!("Blob conversion started.");
log!("[rs] Blob conversion started.");
let start = now();
let blob_chunks = Array::new_with_length(container.chunks(65536).len().try_into().unwrap());
for (i, chunk) in container.chunks(65536).enumerate() {
@ -76,7 +76,10 @@ pub fn decrypt(
.unwrap(),
);
log!(format!("Blob conversion completed in {}ms", now() - start));
log!(format!(
"[rs] Blob conversion completed in {}ms",
now() - start
));
let data = match container.content_type() {
ContentType::Text => DecryptedData::String(Arc::new(

View file

@ -310,7 +310,7 @@ fn on_success(
.unwrap();
put_action.set_onsuccess(Some(
Closure::once(Box::new(|| {
log!("success");
log!("[rs] Successfully inserted encrypted item into storage.");
let name = name.map(JsString::from);
let language = language.map(JsString::from);
load_from_db(JsString::from(mimetype.0), name, language);