mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 21:21:42 +00:00
daemon logging: unifying output and timestamps
A little refactor of the ./pkg/log so engine can have a logger instance Signed-off-by: Vincent Batts <vbatts@redhat.com>
This commit is contained in:
+2
-1
@@ -11,6 +11,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/pkg/ioutils"
|
||||
"github.com/docker/docker/pkg/timeutils"
|
||||
"github.com/docker/docker/utils"
|
||||
)
|
||||
|
||||
@@ -255,6 +256,6 @@ func (eng *Engine) Logf(format string, args ...interface{}) (n int, err error) {
|
||||
if !eng.Logging {
|
||||
return 0, nil
|
||||
}
|
||||
prefixedFormat := fmt.Sprintf("[%s] %s\n", eng, strings.TrimRight(format, "\n"))
|
||||
prefixedFormat := fmt.Sprintf("[%s] [%s] %s\n", time.Now().Format(timeutils.RFC3339NanoFixed), eng, strings.TrimRight(format, "\n"))
|
||||
return fmt.Fprintf(eng.Stderr, prefixedFormat, args...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user