fixed RotatingLogger after migrating to new arrayvec

This commit is contained in:
Svyatoslav Nikolsky 2017-11-23 09:34:48 +03:00
parent d793019607
commit 0f0a056225
1 changed files with 5 additions and 1 deletions

View File

@ -66,7 +66,11 @@ impl RotatingLogger {
/// Append new log entry
pub fn append(&self, log: String) {
self.logs.write().insert(0, log);
let mut logs = self.logs.write();
if logs.is_full() {
logs.pop();
}
logs.insert(0, log);
}
/// Return levels