Log how long it took to download/upload a file

This commit is contained in:
ChristianVisintin
2020-12-18 16:14:23 +01:00
parent 386db6278b
commit 61b4a3b76e
2 changed files with 23 additions and 4 deletions

View File

@@ -20,6 +20,7 @@
*/
use super::{FileTransferActivity, FsEntry, InputMode, LogLevel, PopupType};
use crate::utils::fmt_millis;
use std::io::{Read, Seek, Write};
use std::path::{Path, PathBuf};
@@ -239,9 +240,10 @@ impl FileTransferActivity {
self.log(
LogLevel::Info,
format!(
"Saved file \"{}\" to \"{}\"",
"Saved file \"{}\" to \"{}\" (took {} seconds)",
file.abs_path.display(),
remote_path.display()
remote_path.display(),
fmt_millis(self.transfer.started.elapsed()),
)
.as_ref(),
);
@@ -548,9 +550,10 @@ impl FileTransferActivity {
self.log(
LogLevel::Info,
format!(
"Saved file \"{}\" to \"{}\"",
"Saved file \"{}\" to \"{}\" (took {} seconds)",
file.abs_path.display(),
local_file_path.display()
local_file_path.display(),
fmt_millis(self.transfer.started.elapsed()),
)
.as_ref(),
);