2017-07-01 15:05:51 -03:00
|
|
|
package task
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
2017-09-30 14:56:35 -03:00
|
|
|
func (e *Executor) outf(s string, args ...interface{}) {
|
|
|
|
if len(args) == 0 {
|
|
|
|
s, args = "%s", []interface{}{s}
|
|
|
|
}
|
|
|
|
fmt.Fprintf(e.Stdout, s+"\n", args...)
|
2017-07-01 15:05:51 -03:00
|
|
|
}
|
|
|
|
|
2017-09-30 14:56:35 -03:00
|
|
|
func (e *Executor) verboseOutf(s string, args ...interface{}) {
|
|
|
|
if e.Verbose {
|
|
|
|
e.outf(s, args...)
|
|
|
|
}
|
2017-07-01 15:05:51 -03:00
|
|
|
}
|
2017-07-05 20:55:50 -03:00
|
|
|
|
2017-09-30 14:56:35 -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
|
|
|
}
|
2017-09-30 14:56:35 -03:00
|
|
|
fmt.Fprintf(e.Stderr, s+"\n", args...)
|
2017-07-05 20:55:50 -03:00
|
|
|
}
|
|
|
|
|
2017-09-30 14:56:35 -03:00
|
|
|
func (e *Executor) verboseErrf(s string, args ...interface{}) {
|
2017-07-05 20:55:50 -03:00
|
|
|
if e.Verbose {
|
2017-09-30 14:56:35 -03:00
|
|
|
e.errf(s, args...)
|
2017-07-05 20:55:50 -03:00
|
|
|
}
|
|
|
|
}
|