Use common logging in engine

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
This commit is contained in:
Alexandr Morozov 2014-10-24 11:20:17 -07:00
parent 7c62cee51e
commit b3b4043345

View file

@ -6,6 +6,8 @@ import (
"io"
"strings"
"time"
log "github.com/Sirupsen/logrus"
)
// A job is the fundamental unit of work in the docker engine.
@ -66,10 +68,12 @@ func (job *Job) Run() error {
return fmt.Errorf("%s: job has already completed", job.Name)
}
// Log beginning and end of the job
job.Eng.Logf("+job %s", job.CallString())
defer func() {
job.Eng.Logf("-job %s%s", job.CallString(), job.StatusString())
}()
if job.Eng.Logging {
log.Infof("+job %s", job.CallString())
defer func() {
log.Infof("-job %s%s", job.CallString(), job.StatusString())
}()
}
var errorMessage = bytes.NewBuffer(nil)
job.Stderr.Add(errorMessage)
if job.handler == nil {