From 66819c0a0d86f22d44c26aac829afad9316117e1 Mon Sep 17 00:00:00 2001 From: filzrev <103790468+filzrev@users.noreply.github.com> Date: Mon, 22 Jul 2024 22:49:57 +0900 Subject: [PATCH] fix: Modify logging behavior when explicitly adding NullLogger by config --- src/BenchmarkDotNet/Configs/ConfigExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BenchmarkDotNet/Configs/ConfigExtensions.cs b/src/BenchmarkDotNet/Configs/ConfigExtensions.cs index 5177227c2a..9f1eac6086 100644 --- a/src/BenchmarkDotNet/Configs/ConfigExtensions.cs +++ b/src/BenchmarkDotNet/Configs/ConfigExtensions.cs @@ -122,7 +122,7 @@ public static class ConfigExtensions internal static ILogger GetNonNullCompositeLogger(this IConfig config) { // if user did not provide any loggers, we use the ConsoleLogger to somehow show the errors to the user - if (config == null || !config.GetLoggers().Any()) + if (config == null || !config.GetLoggers().Any() || config.GetLoggers().All(x => x is NullLogger)) return new CompositeLogger(ImmutableHashSet.Create(ConsoleLogger.Default)); return new CompositeLogger(config.GetLoggers().ToImmutableHashSet());