@cryptotaxi247 / kubo / commits / 23108aaa5

Marshal log ls better

This uses a stringList to output each log command as an item in an array in an object called Strings, instead of using the MessageOutput func. This closes #2636. License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>

Richard Littauer committed May 6, 2016 at 19:31 UTC 23108aaa5df503f09b8c4efc16c41232c5b358b8
1 file changed +3 -5
core/commands/log.go
+3 -5
@@ -3,7 +3,6 @@ package commands
3 import (
4 "fmt"
5 "io"
6 - "strings"
6
7 logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log"
8
@@ -82,13 +81,12 @@ subsystems of a running daemon.
81 `,
82 },
83 Run: func(req cmds.Request, res cmds.Response) {
85 - output := strings.Join(logging.GetSubsystems(), "\n")
86 - res.SetOutput(&MessageOutput{output + "\n"})
84 + res.SetOutput(&stringList{logging.GetSubsystems()})
85 },
86 Marshalers: cmds.MarshalerMap{
89 - cmds.Text: MessageTextMarshaler,
87 + cmds.Text: stringListMarshaler,
88 },
91 - Type: MessageOutput{},
89 + Type: stringList{},
90 }
91
92 var logTailCmd = &cmds.Command{