-
Notifications
You must be signed in to change notification settings - Fork 56
Description
#265 included a writability check to RIO.Prelude.Logger.canUseUtf8, because the previous implementation of canUseUtf8 also had one, although not so explicit, being covered by wantWritableHandle. However, this writability check does not belong in canUseUtf8, as it has nothing to do with encodings.
We should possibly move the writability check further up so that it is directly done during logger initialization.
An alternative is to simply drop the check and rely on actual writes failing when the handle is not writable. The state of a handle can be changed any time no operation is performed on the handle; in particular, the handle can be closed. Therefore, a check for writability during logger initialization anyhow provides no guarantee that the handle will be writable later, except perhaps if the handle is under the sole control of the logger.