Skip to content

Move writability check out of canUseUtf8 or drop it #269

@jeltsch

Description

@jeltsch

#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.

Metadata

Metadata

Assignees

No one assigned

    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