diff options
author | Toon Claes <toon@gitlab.com> | 2023-09-20 16:09:25 +0300 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2023-09-27 16:47:36 +0300 |
commit | 588d0ff6aae2b9823ab5632cc36c41821ab37497 (patch) | |
tree | 06141c72d97f2c225f52606d8006be6ce36f6ae7 | |
parent | fac752fda2f989a1239f687216e57f56436abf18 (diff) |
testhelper: Mute logger when empty
When there is a test failure the logging is printed out. This is
prepended with name of the logs. It's not useful to print that name, if
no logging was recorded by that logger, so mute that message when
recorded log is empty.
-rw-r--r-- | internal/testhelper/logger.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/testhelper/logger.go b/internal/testhelper/logger.go index 8e47d4ec1..e082c029c 100644 --- a/internal/testhelper/logger.go +++ b/internal/testhelper/logger.go @@ -82,7 +82,7 @@ func NewLogger(tb testing.TB, options ...LoggerOption) log.LogrusLogger { } tb.Cleanup(func() { - if !tb.Failed() { + if !tb.Failed() || logOutput.Len() == 0 { return } |