diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-26 10:23:10 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-26 11:00:50 +1000 |
commit | 077f11361805417c15234c62a9f9aa022f913d43 (patch) | |
tree | 2cf25beba4f96b55392f09d733a14c25c149de07 /pkg/commands | |
parent | 0c6cbe7746660155df0645f01d37150099d21f49 (diff) |
add in-built logging support for a better dev experience
Diffstat (limited to 'pkg/commands')
-rw-r--r-- | pkg/commands/commit_list_builder.go | 2 | ||||
-rw-r--r-- | pkg/commands/git.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pkg/commands/commit_list_builder.go b/pkg/commands/commit_list_builder.go index ccf253a54..ec988ec62 100644 --- a/pkg/commands/commit_list_builder.go +++ b/pkg/commands/commit_list_builder.go @@ -248,7 +248,7 @@ func (c *CommitListBuilder) getNormalRebasingCommits() ([]*Commit, error) { func (c *CommitListBuilder) getInteractiveRebasingCommits() ([]*Commit, error) { bytesContent, err := ioutil.ReadFile(fmt.Sprintf("%s/rebase-merge/git-rebase-todo", c.GitCommand.DotGitDir)) if err != nil { - c.Log.Info(fmt.Sprintf("error occurred reading git-rebase-todo: %s", err.Error())) + c.Log.Error(fmt.Sprintf("error occurred reading git-rebase-todo: %s", err.Error())) // we assume an error means the file doesn't exist so we just return return nil, nil } diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 3f671b9ff..7b37968ed 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -246,7 +246,7 @@ func (c *GitCommand) GetStatusFiles(opts GetStatusFileOptions) []*File { for _, statusString := range statusStrings { if strings.HasPrefix(statusString, "warning") { - c.Log.Warning(statusString) + c.Log.Warningf("warning when calling git status: %s", statusString) continue } change := statusString[0:2] @@ -792,8 +792,8 @@ func (c *GitCommand) WorktreeFileDiffCmdStr(file *File, plain bool, cached bool) } func (c *GitCommand) ApplyPatch(patch string, flags ...string) error { - c.Log.Warn(patch) filepath := filepath.Join(c.Config.GetUserConfigDir(), utils.GetCurrentRepoName(), time.Now().Format("Jan _2 15.04.05.000000000")+".patch") + c.Log.Infof("saving temporary patch to %s", filepath) if err := c.OSCommand.CreateFileWithContent(filepath, patch); err != nil { return err } |