Wed Apr 15 09:23:25 EDT 2020

Log union

A recurring problem: how to handle log messages coming from many
different subsystems?

One way to handle it is to ensure that log messages are packaged at
the source.  E.g. do not send raw stderr chunks.  That just makes it
very hard to use.

If that's not possible, add a framing mechanism as soon as possible.


While it's a nice idea to let devices only produce framed log
messages, it does look like this puts the burden of abstraction in the
wrong place.  Log messages should be easy to use.  They are ad-hoc.
If they are not ad-hoc, they should be structured more than just
moving from byte stream to line steam.

So stick with raw streams, and add a line parser when merging.


The solution is to add line buffers for every stream that is merged.
It doesn't matter where it is implemented, so implement it at the most
convenient place.  That might be all the way at the top.

So let's add another tag for tagged logs.