port usage of jsonlog to the new daemon files which were refactored

recently.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
This commit is contained in:
Erik Hollensbe 2014-08-06 16:45:04 -07:00
parent 5cdb9c8aca
commit bd373712d0
2 changed files with 6 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import (
"time"
"github.com/docker/docker/engine"
"github.com/docker/docker/pkg/jsonlog"
"github.com/docker/docker/utils"
)
@ -57,7 +58,7 @@ func (daemon *Daemon) ContainerAttach(job *engine.Job) engine.Status {
} else {
dec := json.NewDecoder(cLog)
for {
l := &utils.JSONLog{}
l := &jsonlog.JSONLog{}
if err := dec.Decode(l); err == io.EOF {
break

View File

@ -12,6 +12,7 @@ import (
"github.com/docker/docker/pkg/tailfile"
"github.com/docker/docker/engine"
"github.com/docker/docker/pkg/jsonlog"
"github.com/docker/docker/utils"
)
@ -89,7 +90,7 @@ func (daemon *Daemon) ContainerLogs(job *engine.Job) engine.Status {
}
dec := json.NewDecoder(cLog)
for {
l := &utils.JSONLog{}
l := &jsonlog.JSONLog{}
if err := dec.Decode(l); err == io.EOF {
break
@ -115,13 +116,13 @@ func (daemon *Daemon) ContainerLogs(job *engine.Job) engine.Status {
if stdout {
stdoutPipe := container.StdoutLogPipe()
go func() {
errors <- utils.WriteLog(stdoutPipe, job.Stdout, format)
errors <- jsonlog.WriteLog(stdoutPipe, job.Stdout, format)
}()
}
if stderr {
stderrPipe := container.StderrLogPipe()
go func() {
errors <- utils.WriteLog(stderrPipe, job.Stderr, format)
errors <- jsonlog.WriteLog(stderrPipe, job.Stderr, format)
}()
}
err := <-errors