Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cli.Command{ Name: "logs", Usage: "logs query", Action: func(ctx *cli.Context) error { defer xerror.RespExit() config := tail.Config{Follow: true} n := int64(0) if ctx.NArg() < 1 { fmt.Println("need one or more files as arguments") os.Exit(1) } mapping := bleve.NewIndexMapping() index, err := bleve.New("logs/bleve", mapping) if err == bleve.ErrorIndexPathExists { index, err = bleve.Open("logs/bleve") xerror.Panic(err) } go searchInit(index, "logs", ":8095") if n != 0 { config.Location = &tail.SeekInfo{Offset: -n, Whence: io.SeekEnd} } done := make(chan bool) xerror.Panic(fastwalk.FastWalk(ctx.Args().First(), func(path string, typ os.FileMode) error { if typ.IsDir() { return nil } go tailFile(index, path, config, done) return nil })) select {} }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.