core/commands: Renamed 'log read' to 'log tail'
Matt Bell committed
Jan 23, 2015 at 14:49 UTC
68b2a3f15ce944219b5777b031d7cf55a0e94c7d
1 file changed
+6
-7
core/commands/log.go
+6
-7
@@ -5,9 +5,10 @@ import (
5
"io"
6
"strings"
7
8
- tail "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/ActiveState/tail"
8
cmds "github.com/jbenet/go-ipfs/commands"
9
u "github.com/jbenet/go-ipfs/util"
10
+
11
+ tail "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/ActiveState/tail"
12
)
13
14
// Golang os.Args overrides * and replaces the character argument with
@@ -27,7 +28,7 @@ output of a running daemon.
28
29
Subcommands: map[string]*cmds.Command{
30
"level": logLevelCmd,
30
- "read": logReadCmd,
31
+ "tail": logTailCmd,
32
},
33
}
34
@@ -69,14 +70,11 @@ output of a running daemon.
70
Type: MessageOutput{},
71
}
72
72
-var logReadCmd = &cmds.Command{
73
+var logTailCmd = &cmds.Command{
74
Helptext: cmds.HelpText{
75
Tagline: "Read the logs",
76
ShortDescription: `
76
-'ipfs log read' is a utility command used to read the log output.
77
-
78
-By default, the last 50 lines are returned. For more, use '-n=<number of lines>'.
79
-Use '--stream' (or '-s') to stream the current output (in addition to the '-n' lines).
77
+'ipfs log tail' is a utility command used to read log output as it is written.
78
`,
79
},
80
@@ -98,6 +96,7 @@ Use '--stream' (or '-s') to stream the current output (in addition to the '-n' l
96
fmt.Println(err.Error())
97
return
98
}
99
+ defer t.Stop()
100
101
for line := range t.Lines {
102
if line.Err != nil {