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

@ -4,11 +4,12 @@ import (
"errors"
"fmt"
"net"
"os"
"os/exec"
"regexp"
"strconv"
"strings"
"github.com/docker/docker/pkg/log"
)
type Action string
@ -175,9 +176,7 @@ func Raw(args ...string) ([]byte, error) {
args = append([]string{"--wait"}, args...)
}
if os.Getenv("DEBUG") != "" {
fmt.Fprintf(os.Stderr, fmt.Sprintf("[debug] %s, %v\n", path, args))
}
log.Debugf("%s, %v", path, args)
output, err := exec.Command(path, args...).CombinedOutput()
if err != nil {