Stream to lines helper object
It turns out that it is a common task to accumulate read text until we reach the end of the line and then log that (or potentially handle it in another way). This is the case when we read text from a file, pipe from subprocess or even when we integrate with some other logging method.
It might make sense to implement it as fopencookie
handle as in general what we want is write
function that accumulates text until we get the end of the line. It is a question if-then callback should happen or if a user should call a function that checks for a new line (I think that the first is preferable as that decreases the amount of stored data).
It might also be interesting to have mode when we keep last X number of bytes in buffer. This might be beneficial for applications that run subprocesses and want to receive end of their output on failure (where commonly error resides).