Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LogMatcher = func(occurrences int, subStr string, logs []string) (bool, string) { errMsg := fmt.Sprintf("subStr '%s' does not occur %d time(s) in %v", subStr, occurrences, logs) if len(logs) < occurrences { return false, errMsg } var count int for _, log := range logs { if strings.Contains(log, subStr) { count++ } } if count >= occurrences { return true, "" } return false, errMsg }
LogMatcher is a helper func that returns true if the subStr appears more than 'occurrences' times in the logs.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
Buffer wraps zaptest.Buffer and provides convenience method JSONLine(n)
func NewLogger ¶
NewLogger creates a new zap.Logger backed by a zaptest.Buffer, which is also returned.
Click to show internal directories.
Click to hide internal directories.