I have created a custom logger to write all of my logs to file as well as to the android log. Since file writing is a blocking operation I now want to make the file-write asynchronous with Kotlin coroutines. Just wrapping the write in a coroutine doesn't work because then some logs get switched around and aren't written to file in the correct order. How can I make sure the logs are written sequentially while not blocking the main thread with file operations, optimally using Kotlin coroutines?