Made DiskLogger errors to be appended to buffer instead of being logged to avoid potential infinite loop.

This commit is contained in:
Wojciech Nagrodzki 2018-08-25 12:27:10 +02:00
parent ec98042420
commit c3e2462104
Signed by: wnagrodzki
GPG key ID: E9D0EB0302264569

View file

@ -71,8 +71,9 @@ public final class DiskLogger: Logger {
}
}
catch {
let message = String(describing: error)
self.log(message, level: .warning)
let message = self.formatter.string(from: Date()) + " <" + LogLevel.warning.logDescription + "> " + String(describing: error)
let data = Data(message.utf8)
self.buffer.append(data)
}
}
}