summaryrefslogtreecommitdiffstats
path: root/pkg/app/logging.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/app/logging.go')
-rw-r--r--pkg/app/logging.go22
1 files changed, 1 insertions, 21 deletions
diff --git a/pkg/app/logging.go b/pkg/app/logging.go
index 93e5287e8..6a3c1e7c0 100644
--- a/pkg/app/logging.go
+++ b/pkg/app/logging.go
@@ -3,33 +3,13 @@
package app
import (
- "fmt"
"github.com/aybabtme/humanlog"
- "github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/secureexec"
"log"
"os"
)
-func TailLogs() {
- logFilePath, err := config.LogPath()
- if err != nil {
- log.Fatal(err)
- }
-
- fmt.Printf("Tailing log file %s\n\n", logFilePath)
-
- opts := humanlog.DefaultOptions
- opts.Truncates = false
-
- _, err = os.Stat(logFilePath)
- if err != nil {
- if os.IsNotExist(err) {
- log.Fatal("Log file does not exist. Run `lazygit --debug` first to create the log file")
- }
- log.Fatal(err)
- }
-
+func TailLogsForPlatform(logFilePath string, opts *humanlog.HandlerOptions) {
cmd := secureexec.Command("tail", "-f", logFilePath)
stdout, _ := cmd.StdoutPipe()