Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions runner/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type logFunc func(string, ...interface{})

var logger = logPkg.New(colorable.NewColorableStderr(), "", 0)

func newLogFunc(prefix string) func(string, ...interface{}) {
func newLogFunc(prefix string, withEscape bool) func(string, ...interface{}) {
color, clear := "", ""
if settings["colors"] == "1" {
color = fmt.Sprintf("\033[%sm", logColor(prefix))
Expand All @@ -24,7 +24,11 @@ func newLogFunc(prefix string) func(string, ...interface{}) {
now := time.Now()
timeString := fmt.Sprintf("%d:%d:%02d", now.Hour(), now.Minute(), now.Second())
format = fmt.Sprintf("%s%s %s |%s %s", color, timeString, prefix, clear, format)
logger.Printf(format, v...)
if withEscape {
logger.Printf(format, v...)
} else {
logger.Print(format)
}
}
}

Expand Down
10 changes: 5 additions & 5 deletions runner/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ func init() {
}

func initLogFuncs() {
mainLog = newLogFunc("main")
watcherLog = newLogFunc("watcher")
runnerLog = newLogFunc("runner")
buildLog = newLogFunc("build")
appLog = newLogFunc("app")
mainLog = newLogFunc("main", true)
watcherLog = newLogFunc("watcher", true)
runnerLog = newLogFunc("runner", true)
buildLog = newLogFunc("build", true)
appLog = newLogFunc("app", false)
}

func setEnvVars() {
Expand Down