mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Use common logging in engine
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
This commit is contained in:
parent
7c62cee51e
commit
b3b4043345
1 changed files with 8 additions and 4 deletions
|
@ -6,6 +6,8 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
log "github.com/Sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A job is the fundamental unit of work in the docker engine.
|
// 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)
|
return fmt.Errorf("%s: job has already completed", job.Name)
|
||||||
}
|
}
|
||||||
// Log beginning and end of the job
|
// Log beginning and end of the job
|
||||||
job.Eng.Logf("+job %s", job.CallString())
|
if job.Eng.Logging {
|
||||||
defer func() {
|
log.Infof("+job %s", job.CallString())
|
||||||
job.Eng.Logf("-job %s%s", job.CallString(), job.StatusString())
|
defer func() {
|
||||||
}()
|
log.Infof("-job %s%s", job.CallString(), job.StatusString())
|
||||||
|
}()
|
||||||
|
}
|
||||||
var errorMessage = bytes.NewBuffer(nil)
|
var errorMessage = bytes.NewBuffer(nil)
|
||||||
job.Stderr.Add(errorMessage)
|
job.Stderr.Add(errorMessage)
|
||||||
if job.handler == nil {
|
if job.handler == nil {
|
||||||
|
|
Loading…
Reference in a new issue