Skip to content

Commit

Permalink
More support for verbose=0 level (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdsubhas authored Apr 27, 2017
1 parent f0abeaa commit 16cb824
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions core/execution.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package core

import (
"errors"
"github.com/apex/log"
"github.com/kardianos/osext"
"github.com/pkg/errors"
"os"
"os/exec"
"strings"
Expand Down Expand Up @@ -64,11 +64,11 @@ func (e *Execution) Execute() error {

elapsed := time.Since(start)
if err != nil {
log.Errorf("%v/%v: Failed, Took: %v", e.Project.Name, e.Task.Name, elapsed)
log.Infof("%v: Failed, Took: %v", displayName, elapsed)
} else {
log.Infof("%v: Completed, Took: %v", displayName, elapsed)
}
return err
return errors.Wrap(err, displayName)
}

func (e *Execution) executeTask() error {
Expand Down
4 changes: 3 additions & 1 deletion examples/shell/package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import (
)

var tests = []TestTable{
{Arg: `-v=0 error`, Out: `error`, Err: true},
{Arg: `-v=0 error`, Out: `(Failed){0}`, Err: true},
{Arg: `-v=0 error`, Out: `(foobar.*not found)`, Err: true},
{Arg: `-v=0 echo`, Out: `(Running){0}`},
{Arg: `-v=0 echo`, Out: `(echo){0}`},
{Arg: `-v=1 error`, Out: `(Failed)`, Err: true},
{Arg: `-v=1 error`, Out: `error`, Err: true},
{Arg: `-v=1 error`, Out: `(Failed){0}`, Err: true},
{Arg: `-v=1 echo`, Out: `(Running){0}`},
{Arg: `-v=1 echo`, Out: `(echo)`},
{Arg: `subshell`, Out: `subshell works`},
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

func main() {
if err := cmd.Exec(os.Args[1:]); err != nil {
log.WithError(err).Fatal("error")
log.WithError(err).Error("error")
os.Exit(1)
}
}

0 comments on commit 16cb824

Please sign in to comment.