From a1dcc4acebe72e016b473e6a6a2f9939e08b75c2 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Mon, 2 Jun 2014 00:50:35 +0000 Subject: [PATCH] swarmd: default LOG handler Signed-off-by: Solomon Hykes --- swarmd/swarmd.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/swarmd/swarmd.go b/swarmd/swarmd.go index 45d8f3f1a3..5c8d2be118 100644 --- a/swarmd/swarmd.go +++ b/swarmd/swarmd.go @@ -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() {