Skip to content

RollingFileLogWriter can throw on iOS #468

@xxfast

Description

@xxfast

On iOS - when your device is locked and in background, some restrictions prevent you from writing the log files. This causes these exceptions to be thrown

kotlinx.io.IOException: fflush failed with errno 1 (Operation not permitted)
    at 0   debug.dylib                  0x11742031b        kfun:kotlinx.io.files.throwIOExceptionForErrno#internal + 547 
    at 1   debug.dylib                  0x11741fff3        kfun:kotlinx.io.files.FileSink#flush(){} + 239 
    at 2  debug.dylib                  0x11741415b        kfun:kotlinx.io.RealSink#flush(){} + 435 
    at 3   debug.dylib                  0x11767fc8f        kfun:co.touchlab.kermit.io.$writerCOROUTINE$0.invokeSuspend#internal + 1515  

I think we need to handle these in the writer() coroutine 🤔

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions