Merge pull request #7129 from paritytech/fix_logger

Fixed `RotatingLogger` after migrating to new arrayvec
This commit is contained in:
Marek Kotewicz 2017-11-24 14:31:46 +01:00 committed by GitHub
commit 06ff816afb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,7 +66,11 @@ impl RotatingLogger {
/// Append new log entry /// Append new log entry
pub fn append(&self, log: String) { 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 /// Return levels