From 8ba442aca65c8333a2c78c566e064cc0e8ad1f88 Mon Sep 17 00:00:00 2001 From: Lynn Cyrin Date: Mon, 24 Jun 2019 20:50:37 -0700 Subject: [PATCH] init the loggers in tests --- text_formatter_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/text_formatter_test.go b/text_formatter_test.go index 775f4aa..d04fbcd 100644 --- a/text_formatter_test.go +++ b/text_formatter_test.go @@ -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