diff --git a/pkg/match/payload/json_comparator.go b/pkg/match/payload/json_comparator.go index f1bbeec..b4f4b73 100644 --- a/pkg/match/payload/json_comparator.go +++ b/pkg/match/payload/json_comparator.go @@ -7,7 +7,6 @@ import ( "reflect" "regexp" "strings" - "log" ) var log = logger.Log @@ -24,7 +23,7 @@ func (jc *JSONComparator) doCompareJSONRegexUnmarshaled(patterns, values map[str var matches bool matches = jc.match(patterns, values) if !matches{ - log.Printf("values: %v don't match: %v", values, patterns) + log.Debugf("values: %v don't match: %v", values, patterns) } return matches } @@ -64,7 +63,7 @@ func (jc *JSONComparator) doCompareArrayRegexUnmarshaled(patterns, values []map[ for i := 0; i < len(patterns); i++ { if !jc.match(patterns[i], values[i]) { - log.Printf("value %v doesn't match %v", + log.Debugf("value %v doesn't match %v", values[i], patterns[i]) return false } @@ -94,7 +93,7 @@ func (jc *JSONComparator) match(p, v map[string]interface{}) bool { patternType = reflect.ValueOf(pattern).Kind() if valueType == reflect.Map && patternType == reflect.Map { - log.Printf("recursing into map %v", field) + log.Debugf("recursing into map %v", field) result = jc.doCompareJSONRegexUnmarshaled( pattern.(map[string]interface{}), @@ -106,12 +105,12 @@ func (jc *JSONComparator) match(p, v map[string]interface{}) bool { } else if (valueType == reflect.Array || valueType == reflect.Slice) && (patternType == reflect.Array || patternType == reflect.Slice) { - log.Printf("recursing into array %v", field) + log.Debugf("recursing into array %v", field) valueJsonBytes, err1 := json.Marshal(value) patternJsonBytes, err2 := json.Marshal(pattern) if err1 != nil || err2 != nil { - log.Printf("value %v raised %v and pattern %v raised %v", + log.Errorf("value %v raised %v and pattern %v raised %v", value, err1, pattern, err2) return false } @@ -127,7 +126,7 @@ func (jc *JSONComparator) match(p, v map[string]interface{}) bool { eql = reflect.DeepEqual(pattern, value) if !eql { - log.Printf("value %v doesn't DeepEqual %v", value, pattern) + log.Debugf("value %v doesn't DeepEqual %v", value, pattern) } return eql diff --git a/pkg/match/request.go b/pkg/match/request.go index cb9529c..b567994 100644 --- a/pkg/match/request.go +++ b/pkg/match/request.go @@ -3,7 +3,6 @@ package match import ( "errors" "fmt" - "log" "regexp" "strings"