From 48bcd87555f979d7726f156512b57dc84c86b5e3 Mon Sep 17 00:00:00 2001 From: Mukul Sabharwal Date: Thu, 19 Dec 2019 21:02:01 -0800 Subject: [PATCH] Upgrade to .NET Core 3.1 --- Deserializer/packages.config | 4 ---- ETW2JSON.csproj | 7 ++++--- Program.cs | 40 +++++++++++++++++------------------- README.md | 2 +- 4 files changed, 24 insertions(+), 29 deletions(-) delete mode 100644 Deserializer/packages.config diff --git a/Deserializer/packages.config b/Deserializer/packages.config deleted file mode 100644 index 86d59ae..0000000 --- a/Deserializer/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/ETW2JSON.csproj b/ETW2JSON.csproj index b924cc3..42c668e 100644 --- a/ETW2JSON.csproj +++ b/ETW2JSON.csproj @@ -2,12 +2,13 @@ Exe - netcoreapp3.0 + netcoreapp3.1 + 8.0 true embedded true true - 1.3.9 + 1.3.10 mjsabby Microsoft @@ -19,7 +20,7 @@ - + diff --git a/Program.cs b/Program.cs index 77315ff..604732e 100644 --- a/Program.cs +++ b/Program.cs @@ -11,7 +11,7 @@ public static class Program { - private static string Usage = "Usage: ETW2JSON filename.etl [filename2.etl] -output=filename.json"; + private static readonly string Usage = "Usage: ETW2JSON filename.etl [filename2.etl] -output=filename.json"; public static bool ConvertToJson(Utf8JsonWriter jsonWriter, IEnumerable inputFiles, Action reportError) { @@ -99,29 +99,27 @@ return; } - using (var stream = new FileStream(commandLineInfo.Output, FileMode.Create, FileAccess.Write)) + using var stream = new FileStream(commandLineInfo.Output, FileMode.Create, FileAccess.Write); + var jsonWriter = new Utf8JsonWriter(stream); + + Stopwatch watch = new Stopwatch(); + watch.Start(); + + foreach (var file in commandLineInfo.Inputs) { - var jsonWriter = new Utf8JsonWriter(stream); + Console.WriteLine("Input: " + file); + } - Stopwatch watch = new Stopwatch(); - watch.Start(); + Console.WriteLine("Output: " + commandLineInfo.Output); - foreach (var file in commandLineInfo.Inputs) - { - Console.WriteLine("Input: " + file); - } - - Console.WriteLine("Output: " + commandLineInfo.Output); - - bool success = ConvertToJson(jsonWriter, commandLineInfo.Inputs, Console.WriteLine); - if (!success) - { - Console.WriteLine("Error encountered."); - } - else - { - Console.WriteLine("Finished processing in " + watch.ElapsedMilliseconds + " milliseconds"); - } + bool success = ConvertToJson(jsonWriter, commandLineInfo.Inputs, Console.WriteLine); + if (!success) + { + Console.WriteLine("Error encountered."); + } + else + { + Console.WriteLine("Finished processing in " + watch.ElapsedMilliseconds + " milliseconds"); } } diff --git a/README.md b/README.md index 6597cd0..aeec1f2 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ETW2JSON is a tool that converts ETW Log Files (.ETL) to JSON using the Newtonso ## Nuget package -This library is available on Nuget -- https://www.nuget.org/packages/ETW2JSON/1.3.9 +This library is available on Nuget -- https://www.nuget.org/packages/ETW2JSON/1.3.10 ## Why JSON?