Explorar o código

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>
Cory Snider %!s(int64=3) %!d(string=hai) anos
pai
achega
990b0e28ba
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      daemon/logger/local/read.go

+ 1 - 1
daemon/logger/local/read.go

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