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:
Vincent Batts 2014-09-25 12:55:53 -04:00
parent 56483ba9b4
commit d53bedb1b7
4 changed files with 69 additions and 36 deletions

View file

@ -1,11 +1,12 @@
package signal
import (
"log"
"os"
gosignal "os/signal"
"sync/atomic"
"syscall"
"github.com/docker/docker/pkg/log"
)
// Trap sets up a simplified signal "trap", appropriate for common
@ -28,7 +29,7 @@ func Trap(cleanup func()) {
interruptCount := uint32(0)
for sig := range c {
go func(sig os.Signal) {
log.Printf("Received signal '%v', starting shutdown of docker...\n", sig)
log.Infof("Received signal '%v', starting shutdown of docker...", sig)
switch sig {
case os.Interrupt, syscall.SIGTERM:
// If the user really wants to interrupt, let him do so.
@ -43,7 +44,7 @@ func Trap(cleanup func()) {
return
}
} else {
log.Printf("Force shutdown of docker, interrupting cleanup\n")
log.Infof("Force shutdown of docker, interrupting cleanup")
}
case syscall.SIGQUIT:
}