init the loggers in tests

This commit is contained in:
Lynn Cyrin 2019-06-24 20:50:37 -07:00
parent 693469de8f
commit 8ba442aca6
1 changed files with 4 additions and 1 deletions

View File

@ -233,8 +233,11 @@ func TestPadLevelText(t *testing.T) {
var bytesWithPadding bytes.Buffer
// The TextFormatter instance and the bytes.Buffer instance are different here
// all the other arguments are the same
// all the other arguments are the same. We also initialize them so that they
// fill in the value of levelTextMaxLength.
tfDefault.init(&Entry{})
tfDefault.printColored(&bytesDefault, &Entry{Level: val.level}, []string{}, nil, "")
tfWithPadding.init(&Entry{})
tfWithPadding.printColored(&bytesWithPadding, &Entry{Level: val.level}, []string{}, nil, "")
// turn the bytes back into a string so that we can actually work with the data