Repository: microsoft/garnet
File: benchmark/Resp.benchmark/RespOnlineBench.cs (C#)

Code before:
                    {
                        Console.WriteLine(
                            $"{"min (us);",pad}" +
                            $"{"5th (us);",pad}" +
                            $"{"median (us);",pad}" +
                            $"{"avg (us);",pad}" +
                            $"{"95th (us);",pad}" +
                            $"{"99th (us);",pad}" +
                            $"{"99.9th (us);",pad}" +
                            $"{"total_ops;",pad}" +
                            $"{"iter_tops;",pad}" +
                            $"{"tpt (Kops/sec)",pad}");
                    }
                    else
                    {
                        var msg = $"{"min (us);",pad}" +
                            $"{"5th (us);",pad}" +
                            $"{"median (us);",pad}" +
                            $"{"avg (us);",pad}" +
                            $"{"95th (us);",pad}" +
                            $"{"99th (us);",pad}" +
                            $"{"99.9th (us);",pad}" +
                            $"{"total_ops;",pad}" +
                            $"{"iter_tops;",pad}" +
                            $"{"tpt (Kops/sec)",pad}";
#pragma warning disable CA2254 // Template should be a static expression
                        logger?.LogInformation(msg);
#pragma warning restore CA2254 // Template should be a static expression
                    }
                }

                var offset = prev_iter & 0x1;
                for (int i = offset * NumThreads; i < offset * NumThreads + NumThreads; i++)
                {
                    summary.Add(thread_histograms[i]);
                    thread_histograms[i].Reset();
                }

                //find operation perform during polling period
                long curr_iter_ops = summary.TotalCount - last_iter_ops;
                //if more than one operation per latency recording
                if (opts.IntraThreadParallelism > 1 && !opts.SyncMode)
                    curr_iter_ops *= opts.IntraThreadParallelism;

                swatch.Stop();

                double elapsedSecs = (double)swatch.ElapsedMilliseconds - epochElapsedMs;

                if (opts.DisableConsoleLogger && opts.FileLogger == null)
                {
                    if (summary.TotalCount > 0)

Review comment (suggestion):
instead of disabling, could we rewrite this (and the other disable sites) as `logger?.LogInformation("{msg}", msg)`

Code after:
                    {
                        Console.WriteLine(
                            $"{"min (us);",pad}" +
                            $"{"5th (us);",pad}" +
                            $"{"median (us);",pad}" +
                            $"{"avg (us);",pad}" +
                            $"{"95th (us);",pad}" +
                            $"{"99th (us);",pad}" +
                            $"{"99.9th (us);",pad}" +
                            $"{"total_ops;",pad}" +
                            $"{"iter_tops;",pad}" +
                            $"{"tpt (Kops/sec)",pad}");
                    }
                    else
                    {
                        var msg = $"{"min (us);",pad}" +
                            $"{"5th (us);",pad}" +
                            $"{"median (us);",pad}" +
                            $"{"avg (us);",pad}" +
                            $"{"95th (us);",pad}" +
                            $"{"99th (us);",pad}" +
                            $"{"99.9th (us);",pad}" +
                            $"{"total_ops;",pad}" +
                            $"{"iter_tops;",pad}" +
                            $"{"tpt (Kops/sec)",pad}";
                        logger?.LogInformation("{msg}", msg);
                    }
                }

                var offset = prev_iter & 0x1;
                for (int i = offset * NumThreads; i < offset * NumThreads + NumThreads; i++)
                {
                    summary.Add(thread_histograms[i]);
                    thread_histograms[i].Reset();
                }

                //find operation perform during polling period
                long curr_iter_ops = summary.TotalCount - last_iter_ops;
                //if more than one operation per latency recording
                if (opts.IntraThreadParallelism > 1 && !opts.SyncMode)
                    curr_iter_ops *= opts.IntraThreadParallelism;

                swatch.Stop();

                double elapsedSecs = (double)swatch.ElapsedMilliseconds - epochElapsedMs;

                if (opts.DisableConsoleLogger && opts.FileLogger == null)
                {
                    if (summary.TotalCount > 0)
                    {
                        Console.WriteLine(