mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
don't call projectPath until we know we're in debug mode
This commit is contained in:
parent
750445dc8b
commit
bebe94b4b3
1 changed files with 4 additions and 4 deletions
8
main.go
8
main.go
|
@ -44,22 +44,22 @@ func projectPath(path string) string {
|
|||
}
|
||||
|
||||
func devLog(objects ...interface{}) {
|
||||
localLog(color.FgWhite, projectPath("development.log"), objects...)
|
||||
localLog(color.FgWhite, "development.log", objects...)
|
||||
}
|
||||
|
||||
func colorLog(colour color.Attribute, objects ...interface{}) {
|
||||
localLog(colour, projectPath("development.log"), objects...)
|
||||
localLog(colour, "development.log", objects...)
|
||||
}
|
||||
|
||||
func commandLog(objects ...interface{}) {
|
||||
localLog(color.FgWhite, projectPath("commands.log"), objects...)
|
||||
localLog(color.FgWhite, "commands.log", objects...)
|
||||
}
|
||||
|
||||
func localLog(colour color.Attribute, path string, objects ...interface{}) {
|
||||
if !*debuggingFlag {
|
||||
return
|
||||
}
|
||||
f, _ := os.OpenFile(path, os.O_APPEND|os.O_WRONLY, 0644)
|
||||
f, _ := os.OpenFile(projectPath(path), os.O_APPEND|os.O_WRONLY, 0644)
|
||||
defer f.Close()
|
||||
for _, object := range objects {
|
||||
colorFunction := color.New(colour).SprintFunc()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue