MCPcopy
hub / github.com/jesseduffield/lazygit / tailLogsForPlatform

Function tailLogsForPlatform

pkg/logs/tail/logs_windows.go:13–30  ·  view source on GitHub ↗
(logFilePath string, opts *humanlog.HandlerOptions)

Source from the content-addressed store, hash-verified

11)
12
13func tailLogsForPlatform(logFilePath string, opts *humanlog.HandlerOptions) {
14 var lastModified int64 = 0
15 var lastOffset int64 = 0
16 for {
17 stat, err := os.Stat(logFilePath)
18 if err != nil {
19 log.Fatal(err)
20 }
21 if stat.ModTime().Unix() > lastModified {
22 err = tailFrom(lastOffset, logFilePath, opts)
23 if err != nil {
24 log.Fatal(err)
25 }
26 }
27 lastOffset = stat.Size()
28 time.Sleep(1 * time.Second)
29 }
30}
31
32func openAndSeek(filepath string, offset int64) (*os.File, error) {
33 file, err := os.Open(filepath)

Callers

nothing calls this directly

Calls 2

tailFromFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected