My interpretation of what is going on here might be wrong, but this feels like a spin lock where this while loop is oftentimes reading the value the `Sync()` method added to itself.

The semantics of the method itself are a little weird. It's not abundantly clear that this blocks until he channel is empty as opposed to some useful notion of "Block until all logs issued before this invocation are persisted to disk, but not necessarily any of the logs instantiated after".

A third point, using the `Sync()` signature as a name collides with a method on the embedded os.File. If changing this signature of this method in the future, the compiler won't catch any problems and users will unwittingly be telling the file to flush to disk.

I suggest changing the name to say `WaitUntilEmpty` to kill 2 and 3 with 1 stone.