1
0
mirror of https://github.com/go-task/task.git synced 2025-03-19 21:17:46 +02:00
task/log.go

32 lines
564 B
Go
Raw Normal View History

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...)
}
}
2017-07-05 20:55:50 -03:00
func (e *Executor) errf(s string, args ...interface{}) {
if len(args) == 0 {
s, args = "%s", []interface{}{s}
2017-07-05 20:55:50 -03:00
}
fmt.Fprintf(e.Stderr, s+"\n", args...)
2017-07-05 20:55:50 -03:00
}
func (e *Executor) verboseErrf(s string, args ...interface{}) {
2017-07-05 20:55:50 -03:00
if e.Verbose {
e.errf(s, args...)
2017-07-05 20:55:50 -03:00
}
}