Merge pull request #39038 from alexei38/plugin_partial

Adds PartialLogMetadata to encode protobuf for logger plugins
This commit is contained in:
Sebastiaan van Stijn 2019-04-10 03:09:33 +02:00 committed by GitHub
commit 0c17c01526
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,6 +39,13 @@ func (a *pluginAdapter) Log(msg *Message) error {
a.buf.TimeNano = msg.Timestamp.UnixNano()
a.buf.Partial = msg.PLogMetaData != nil
a.buf.Source = msg.Source
if msg.PLogMetaData != nil {
a.buf.PartialLogMetadata = &logdriver.PartialLogEntryMetadata{
Id: msg.PLogMetaData.ID,
Last: msg.PLogMetaData.Last,
Ordinal: int32(msg.PLogMetaData.Ordinal),
}
}
err := a.enc.Encode(&a.buf)
a.buf.Reset()