1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-19 01:39:35 +08:00

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

This commit is contained in:
Matt Bell
2015-01-23 14:49:21 -08:00
parent 81d17e0843
commit 68b2a3f15c

View File

@ -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.
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.
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
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 {