From b3b40433451d8e76d02dc70d591027f680c9a3bf Mon Sep 17 00:00:00 2001 From: Alexandr Morozov Date: Fri, 24 Oct 2014 11:20:17 -0700 Subject: [PATCH] Use common logging in engine Signed-off-by: Alexandr Morozov --- engine/job.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/engine/job.go b/engine/job.go index d032ff0215..ecd9441ff5 100644 --- a/engine/job.go +++ b/engine/job.go @@ -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 {