github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/daemon/logger/jsonfilelog/jsonlog/jsonlog.go (about)

     1  package jsonlog // import "github.com/demonoid81/moby/daemon/logger/jsonfilelog/jsonlog"
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  // JSONLog is a log message, typically a single entry from a given log stream.
     8  type JSONLog struct {
     9  	// Log is the log message
    10  	Log string `json:"log,omitempty"`
    11  	// Stream is the log source
    12  	Stream string `json:"stream,omitempty"`
    13  	// Created is the created timestamp of log
    14  	Created time.Time `json:"time"`
    15  	// Attrs is the list of extra attributes provided by the user
    16  	Attrs map[string]string `json:"attrs,omitempty"`
    17  }
    18  
    19  // Reset all fields to their zero value.
    20  func (jl *JSONLog) Reset() {
    21  	jl.Log = ""
    22  	jl.Stream = ""
    23  	jl.Created = time.Time{}
    24  	for k := range jl.Attrs {
    25  		delete(jl.Attrs, k)
    26  	}
    27  }