1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

daemon/logger/local: fix appending newlines

The json-file driver appends a newline character to log messages with
PLogMetaData.Last set, but the local driver did not. Alter the behavior
of the local driver to match that of the json-file driver.

Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
Cory Snider 2022-03-02 17:36:00 -05:00
parent 3844d1a3d1
commit 990b0e28ba

View file

@ -202,7 +202,7 @@ func (d *decoder) decodeLogEntry() (*logger.Message, error) {
}
msg := protoToMessage(d.proto)
if msg.PLogMetaData == nil {
if msg.PLogMetaData == nil || msg.PLogMetaData.Last {
msg.Line = append(msg.Line, '\n')
}