Commit 68b2a3f1 authored by Matt Bell's avatar Matt Bell

core/commands: Renamed 'log read' to 'log tail'

parent 81d17e08
...@@ -5,9 +5,10 @@ import ( ...@@ -5,9 +5,10 @@ import (
"io" "io"
"strings" "strings"
tail "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/ActiveState/tail"
cmds "github.com/jbenet/go-ipfs/commands" cmds "github.com/jbenet/go-ipfs/commands"
u "github.com/jbenet/go-ipfs/util" u "github.com/jbenet/go-ipfs/util"
tail "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/ActiveState/tail"
) )
// Golang os.Args overrides * and replaces the character argument with // Golang os.Args overrides * and replaces the character argument with
...@@ -27,7 +28,7 @@ output of a running daemon. ...@@ -27,7 +28,7 @@ output of a running daemon.
Subcommands: map[string]*cmds.Command{ Subcommands: map[string]*cmds.Command{
"level": logLevelCmd, "level": logLevelCmd,
"read": logReadCmd, "tail": logTailCmd,
}, },
} }
...@@ -69,14 +70,11 @@ output of a running daemon. ...@@ -69,14 +70,11 @@ output of a running daemon.
Type: MessageOutput{}, Type: MessageOutput{},
} }
var logReadCmd = &cmds.Command{ var logTailCmd = &cmds.Command{
Helptext: cmds.HelpText{ Helptext: cmds.HelpText{
Tagline: "Read the logs", Tagline: "Read the logs",
ShortDescription: ` ShortDescription: `
'ipfs log read' is a utility command used to read the log output. 'ipfs log tail' is a utility command used to read log output as it is written.
By default, the last 50 lines are returned. For more, use '-n=<number of lines>'.
Use '--stream' (or '-s') to stream the current output (in addition to the '-n' lines).
`, `,
}, },
...@@ -98,6 +96,7 @@ Use '--stream' (or '-s') to stream the current output (in addition to the '-n' l ...@@ -98,6 +96,7 @@ Use '--stream' (or '-s') to stream the current output (in addition to the '-n' l
fmt.Println(err.Error()) fmt.Println(err.Error())
return return
} }
defer t.Stop()
for line := range t.Lines { for line := range t.Lines {
if line.Err != nil { if line.Err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment