Extract log utils into pkg/log

Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
This commit is contained in:
Josiah Kiehl 2014-07-24 13:37:44 -07:00 committed by Erik Hollensbe
parent f5d12e100c
commit 6d4b3605f7
5 changed files with 123 additions and 7 deletions

View file

@ -4,11 +4,11 @@ import (
"bytes"
"encoding/json"
"io"
"log"
"sync"
"time"
"github.com/docker/docker/pkg/jsonlog"
"github.com/docker/docker/pkg/log"
)
// BroadcastWriter accumulate multiple io.WriteCloser by stream.
@ -56,7 +56,7 @@ func (w *BroadcastWriter) Write(p []byte) (n int, err error) {
}
b, err := json.Marshal(jsonlog.JSONLog{Log: line, Stream: stream, Created: created})
if err != nil {
log.Printf("Error making JSON log line: %s", err)
log.Errorf("Error making JSON log line: %s", err)
continue
}
b = append(b, '\n')