mirror of https://github.com/docker/docs.git
swarmd: default LOG handler
Signed-off-by: Solomon Hykes <solomon@docker.com>
This commit is contained in:
parent
4f3c557bcf
commit
a1dcc4aceb
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"github.com/codegangsta/cli"
|
"github.com/codegangsta/cli"
|
||||||
"github.com/docker/libswarm/beam"
|
"github.com/docker/libswarm/beam"
|
||||||
"github.com/docker/libswarm/beam/inmem"
|
"github.com/docker/libswarm/beam/inmem"
|
||||||
|
@ -154,6 +155,11 @@ func cmdDaemon(c *cli.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
hub := beamutils.NewHub()
|
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()
|
back := backends.New()
|
||||||
// Load backends
|
// Load backends
|
||||||
for _, cmd := range c.Args() {
|
for _, cmd := range c.Args() {
|
||||||
|
|
Loading…
Reference in New Issue