1
0
mirror of https://github.com/go-task/task.git synced 2025-01-12 04:34:11 +02:00
task/log.go
Andrey Nering abb19dfbf8 print logs to stderr instead of stdout
also, don't print up-to-date status when the --silent flag was given

closes #68
2017-09-30 14:56:35 -03:00

32 lines
564 B
Go

package task
import (
"fmt"
)
func (e *Executor) outf(s string, args ...interface{}) {
if len(args) == 0 {
s, args = "%s", []interface{}{s}
}
fmt.Fprintf(e.Stdout, s+"\n", args...)
}
func (e *Executor) verboseOutf(s string, args ...interface{}) {
if e.Verbose {
e.outf(s, args...)
}
}
func (e *Executor) errf(s string, args ...interface{}) {
if len(args) == 0 {
s, args = "%s", []interface{}{s}
}
fmt.Fprintf(e.Stderr, s+"\n", args...)
}
func (e *Executor) verboseErrf(s string, args ...interface{}) {
if e.Verbose {
e.errf(s, args...)
}
}