BenchmarkDotNet icon indicating copy to clipboard operation
BenchmarkDotNet copied to clipboard

fix: Modify logging behavior when explicitly adding NullLogger with custom config

Open filzrev opened this issue 1 year ago • 2 comments

This PR intended to fix problem no console log is outputted when following conditions met.

  • Using custom config that adding NullLogger explicitly
  • Using custom config as Global Config (passing config as BenchmarkSwitcher::Run parameters)..

Currently BenchmarkDotNet use ConsoleLogger to print errors and list of benchmarks if logger is not enabled. But when explicitly set NullLogger it's not works and no console logs are outputted.

Background

I'm trying to write custom progress logger that resolve #190 issue. And it'll be implemented by using custom EventProcessor that is added from v0.13.9.

So It need to suppress default ConsoleLogger by adding NullLogger. Because when no logger specified following error is recorded.

No loggers defined, you will not see any progress!

It works almost as intended. But when passing custom config to BenchmarkSwitcher::Run argument. console log is not outputted.

filzrev avatar Jul 22 '24 14:07 filzrev