This commit is contained in:
Mukul Sabharwal 2019-12-19 21:02:01 -08:00
Родитель b15f62343e
Коммит 48bcd87555
4 изменённых файлов: 24 добавлений и 29 удалений

Просмотреть файл

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
</packages>

Просмотреть файл

@ -2,12 +2,13 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>embedded</DebugType>
<DebugSymbols>true</DebugSymbols>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.3.9</Version>
<Version>1.3.10</Version>
<Authors>mjsabby</Authors>
<Company>Microsoft</Company>
</PropertyGroup>
@ -19,7 +20,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Security.Principal.Windows" Version="4.6.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="4.7.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

Просмотреть файл

@ -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<string> inputFiles, Action<string> 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");
}
}

Просмотреть файл

@ -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?