mirror of
https://github.com/docker/docs.git
synced 2026-04-05 18:58:55 +07:00
Merge pull request #16228 from duglin/ContextualizeEvents
Add context.RequestID to event stream
This commit is contained in:
@@ -92,6 +92,7 @@ func (p *JSONProgress) String() string {
|
||||
// the created time, where it from, status, ID of the
|
||||
// message. It's used for docker events.
|
||||
type JSONMessage struct {
|
||||
RequestID string `json:"reqid,omitempty"`
|
||||
Stream string `json:"stream,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Progress *JSONProgress `json:"progressDetail,omitempty"`
|
||||
@@ -127,6 +128,9 @@ func (jm *JSONMessage) Display(out io.Writer, isTerminal bool) error {
|
||||
} else if jm.Time != 0 {
|
||||
fmt.Fprintf(out, "%s ", time.Unix(jm.Time, 0).Format(timeutils.RFC3339NanoFixed))
|
||||
}
|
||||
if jm.RequestID != "" {
|
||||
fmt.Fprintf(out, "[reqid: %s] ", jm.RequestID)
|
||||
}
|
||||
if jm.ID != "" {
|
||||
fmt.Fprintf(out, "%s: ", jm.ID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user