mirror of
https://github.com/wnagrodzki/SwiftLogger.git
synced 2025-04-06 12:31:51 +02:00
Improved DiskLogger so rotateLogFiles() method's errors are caught instead of being ignored
This commit is contained in:
parent
0429d58fdc
commit
c83f341d6d
1 changed files with 7 additions and 5 deletions
|
@ -65,11 +65,13 @@ public final class DiskLogger: Logger {
|
|||
|
||||
do {
|
||||
try self.openFileWriter()
|
||||
try self.writeBuffer()
|
||||
}
|
||||
catch is FileWriter.FileSizeLimitReached {
|
||||
self.closeFileWriter()
|
||||
try? self.rotateLogFiles()
|
||||
do {
|
||||
try self.writeBuffer()
|
||||
}
|
||||
catch is FileWriter.FileSizeLimitReached {
|
||||
self.closeFileWriter()
|
||||
try self.rotateLogFiles()
|
||||
}
|
||||
}
|
||||
catch {
|
||||
let message = String(describing: error)
|
||||
|
|
Loading…
Add table
Reference in a new issue