swarmd: default LOG handler

Signed-off-by: Solomon Hykes <solomon@docker.com>
This commit is contained in:
Solomon Hykes 2014-06-02 00:50:35 +00:00
parent 4f3c557bcf
commit a1dcc4aceb
1 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package main
import (
"bufio"
"fmt"
"log"
"github.com/codegangsta/cli"
"github.com/docker/libswarm/beam"
"github.com/docker/libswarm/beam/inmem"
@ -154,6 +155,11 @@ func cmdDaemon(c *cli.Context) {
}
hub := beamutils.NewHub()
hub.RegisterName("log", func(msg *beam.Message, in beam.Receiver, out, next beam.Sender) (bool, error) {
log.Printf("%s\n", strings.Join(msg.Args, " "))
// Pass through to other logging hooks
return true, nil
})
back := backends.New()
// Load backends
for _, cmd := range c.Args() {