cri-o/conmon
Aleksa Sarai afadd0aab9
conmon: handle multi-line logging
The CRI requires us to prepend (timestamp, stream) to every line of the
output, and it's quite likely (especially in the !terminal case) that we
will read more than one line of output in the read loop.

So, we need to write out each line separately with the prepended
timestamps. Doing this the simple way (the final part of the buffer is
written partially if it doesn't end in a newline) makes the code much
simpler, with the downside that if we ever switch to multiple streams
for output we'll have to rewrite parts of this.

In addition, drop the debugging output of cri-o for each chunk read so
we stop spamming stderr. We can do this now because 8a928d06e7
("oci: make ExecSync with ExitCode != 0 act properly") actually fixed
how ExecSync was being handled (especially in regards to this patch).

Fixes: 1dc4c87c93 ("conmon: add timestamps to logs")
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-04-11 20:32:24 +10:00
..
cmsg.c conmon: implement logging to logPath 2017-04-05 02:45:57 +10:00
cmsg.h conmon: implement logging to logPath 2017-04-05 02:45:57 +10:00
conmon.c conmon: handle multi-line logging 2017-04-11 20:32:24 +10:00
Makefile conmon: minor fixes 2016-10-02 20:11:16 +11:00