From 6e4cf454b5c9a744806a0fef6fd7748ec2118da4 Mon Sep 17 00:00:00 2001 From: Lindsay Bec Date: Mon, 29 Jun 2026 13:48:12 +1000 Subject: [PATCH 1/3] update logging to every 1000 batches and autoflush --- src/OtelImporter/Program.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/OtelImporter/Program.cs b/src/OtelImporter/Program.cs index 912ce5d..62af4fa 100644 --- a/src/OtelImporter/Program.cs +++ b/src/OtelImporter/Program.cs @@ -15,6 +15,12 @@ internal static class Importer public static async Task RunAsync(string[] args) { + if (Console.IsOutputRedirected) + { + var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true }; + Console.SetOut(writer); + } + var parse = CommandLineParser.Parse(args); if (parse.Error is not null) { @@ -132,7 +138,7 @@ void ReportDiagnostic(string message) var stopwatch = Stopwatch.StartNew(); var progress = new Progress(count => { - if (count % 100 == 0) + if (count % 1000 == 0) Console.Write($"\r exported {count} batches..."); }); From ba42a966bbd1525601957a06dfd436ca189b7a05 Mon Sep 17 00:00:00 2001 From: Lindsay Bec Date: Tue, 30 Jun 2026 14:46:15 +1000 Subject: [PATCH 2/3] use newline so lines show in k8s logs --- src/OtelImporter/Program.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/OtelImporter/Program.cs b/src/OtelImporter/Program.cs index 62af4fa..3787fe7 100644 --- a/src/OtelImporter/Program.cs +++ b/src/OtelImporter/Program.cs @@ -139,7 +139,12 @@ void ReportDiagnostic(string message) var progress = new Progress(count => { if (count % 1000 == 0) - Console.Write($"\r exported {count} batches..."); + { + if (Console.IsOutputRedirected) + Console.WriteLine($" exported {count} batches..."); + else + Console.Write($"\r exported {count} batches..."); + } }); try From 950d424d98c330610006aff171cf5f50cbab0eb1 Mon Sep 17 00:00:00 2001 From: Lindsay Bec Date: Tue, 30 Jun 2026 14:47:35 +1000 Subject: [PATCH 3/3] revert initial commit adding autoflush --- src/OtelImporter/Program.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/OtelImporter/Program.cs b/src/OtelImporter/Program.cs index 3787fe7..3a229ba 100644 --- a/src/OtelImporter/Program.cs +++ b/src/OtelImporter/Program.cs @@ -15,12 +15,6 @@ internal static class Importer public static async Task RunAsync(string[] args) { - if (Console.IsOutputRedirected) - { - var writer = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true }; - Console.SetOut(writer); - } - var parse = CommandLineParser.Parse(args); if (parse.Error is not null) { @@ -138,7 +132,7 @@ void ReportDiagnostic(string message) var stopwatch = Stopwatch.StartNew(); var progress = new Progress(count => { - if (count % 1000 == 0) + if (count % 100 == 0) { if (Console.IsOutputRedirected) Console.WriteLine($" exported {count} batches...");