1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-23 12:18:51 +02:00

more logging

This commit is contained in:
Jesse Duffield 2020-09-26 10:45:13 +10:00
parent 077f113618
commit f0a1544ebd
3 changed files with 8 additions and 0 deletions

@ -18,6 +18,7 @@ import (
// As return of output you need to give a string that will be written to stdin // As return of output you need to give a string that will be written to stdin
// NOTE: If the return data is empty it won't written anything to stdin // NOTE: If the return data is empty it won't written anything to stdin
func RunCommandWithOutputLiveWrapper(c *OSCommand, command string, output func(string) string) error { func RunCommandWithOutputLiveWrapper(c *OSCommand, command string, output func(string) string) error {
c.Log.WithField("command", command).Info("RunCommand")
cmd := c.ExecutableFromString(command) cmd := c.ExecutableFromString(command)
cmd.Env = append(cmd.Env, "LANG=en_US.UTF-8", "LC_ALL=en_US.UTF-8") cmd.Env = append(cmd.Env, "LANG=en_US.UTF-8", "LC_ALL=en_US.UTF-8")

@ -911,6 +911,7 @@ func (c *GitCommand) PrepareInteractiveRebaseCommand(baseSha string, todo string
} }
cmdStr := fmt.Sprintf("git rebase --interactive --autostash --keep-empty %s", baseSha) cmdStr := fmt.Sprintf("git rebase --interactive --autostash --keep-empty %s", baseSha)
c.Log.WithField("command", cmdStr).Info("RunCommand")
splitCmd := str.ToArgv(cmdStr) splitCmd := str.ToArgv(cmdStr)
cmd := c.OSCommand.command(splitCmd[0], splitCmd[1:]...) cmd := c.OSCommand.command(splitCmd[0], splitCmd[1:]...)

@ -2,12 +2,18 @@ package gui
import ( import (
"os/exec" "os/exec"
"strings"
"github.com/jesseduffield/gocui" "github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/tasks" "github.com/jesseduffield/lazygit/pkg/tasks"
) )
func (gui *Gui) newCmdTask(viewName string, cmd *exec.Cmd) error { func (gui *Gui) newCmdTask(viewName string, cmd *exec.Cmd) error {
gui.Log.WithField(
"command",
strings.Join(cmd.Args, " "),
).Debug("RunCommand")
view, err := gui.g.View(viewName) view, err := gui.g.View(viewName)
if err != nil { if err != nil {
return nil // swallowing for now return nil // swallowing for now