Improve logging

This commit is contained in:
Tomasz Sęk
2019-02-17 00:45:34 +01:00
parent 08b6dfb691
commit 1ad5992160
14 changed files with 154 additions and 119 deletions
+3 -1
View File
@@ -5,6 +5,8 @@ import (
"strings"
"github.com/jenkinsci/kubernetes-operator/pkg/log"
"github.com/pkg/errors"
)
// Plugin represents jenkins plugin
@@ -22,7 +24,7 @@ func (p Plugin) String() string {
func New(nameWithVersion string) (*Plugin, error) {
val := strings.SplitN(nameWithVersion, ":", 2)
if val == nil || len(val) != 2 {
return nil, fmt.Errorf("invalid plugin format '%s'", nameWithVersion)
return nil, errors.Errorf("invalid plugin format '%s'", nameWithVersion)
}
return &Plugin{
Name: val[0],
@@ -9,8 +9,7 @@ import (
)
func TestVerifyDependencies(t *testing.T) {
debug := false
log.SetupLogger(&debug)
log.SetupLogger(false)
t.Run("happy, single root plugin with one dependent plugin", func(t *testing.T) {
basePlugins := map[Plugin][]Plugin{