Merge pull request #9457 from icecrime/engine_logf

Remove unused Engine.Logf method
This commit is contained in:
Jessie Frazelle 2014-12-02 12:17:11 -08:00
commit 906c7211e6
3 changed files with 0 additions and 20 deletions

View File

@ -926,7 +926,6 @@ func NewDaemonFromDirectory(config *Config, eng *engine.Engine) (*Daemon, error)
eng.OnShutdown(func() {
// FIXME: if these cleanup steps can be called concurrently, register
// them as separate handlers to speed up total shutdown time
// FIXME: use engine logging instead of log.Errorf
if err := daemon.shutdown(); err != nil {
log.Errorf("daemon.shutdown(): %s", err)
}

View File

@ -11,7 +11,6 @@ import (
"time"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/timeutils"
"github.com/docker/docker/utils"
)
@ -251,11 +250,3 @@ func (eng *Engine) ParseJob(input string) (*Job, error) {
job.Env().Init(&env)
return job, nil
}
func (eng *Engine) Logf(format string, args ...interface{}) (n int, err error) {
if !eng.Logging {
return 0, nil
}
prefixedFormat := fmt.Sprintf("[%s] [%s] %s\n", time.Now().Format(timeutils.RFC3339NanoFixed), eng, strings.TrimRight(format, "\n"))
return fmt.Fprintf(eng.Stderr, prefixedFormat, args...)
}

View File

@ -99,16 +99,6 @@ func TestEngineString(t *testing.T) {
}
}
func TestEngineLogf(t *testing.T) {
eng := New()
input := "Test log line"
if n, err := eng.Logf("%s\n", input); err != nil {
t.Fatal(err)
} else if n < len(input) {
t.Fatalf("Test: Logf() should print at least as much as the input\ninput=%d\nprinted=%d", len(input), n)
}
}
func TestParseJob(t *testing.T) {
eng := New()
// Verify that the resulting job calls to the right place