// EmitStatus emits the json message on r func EmitStatus(e *core.NormalizedEmitter, r io.Reader, options *core.PipelineOptions) { s := NewJSONMessageProcessor() dec := json.NewDecoder(r) for { var m jsonmessage.JSONMessage if err := dec.Decode(&m); err == io.EOF { // Once the EOF is reached the function will stop break } else if err != nil { util.RootLogger().Panic(err) } line := s.ProcessJSONMessage(&m) e.Emit(core.Logs, &core.LogsArgs{ Logs: line, Stream: "docker", }) } }