Activity log

This commit is contained in:
veeso
2021-05-17 22:15:20 +02:00
parent c1b3511c06
commit 7b868bc60b
8 changed files with 74 additions and 17 deletions

View File

@@ -36,6 +36,12 @@ impl FileTransferActivity {
///
/// Add message to log events
pub(super) fn log(&mut self, level: LogLevel, msg: String) {
// Log to file
match level {
LogLevel::Error => error!("{}", msg),
LogLevel::Info => info!("{}", msg),
LogLevel::Warn => warn!("{}", msg),
}
// Create log record
let record: LogRecord = LogRecord::new(level, msg);
//Check if history overflows the size