From ec9359d15296eaaeac65056eb1b934a85680c898 Mon Sep 17 00:00:00 2001 From: Lessley Dennington Date: Thu, 2 Mar 2023 15:36:35 -0700 Subject: [PATCH 1/4] trace2: move formattargettypes Move the FormatTargetTypes enum from the specific Trace2StreamWriter class to the shared Trace2Writer class, since the Trace2FileWriter class also uses values from this enum. --- src/shared/Core/ITrace2Writer.cs | 10 ++++++++++ src/shared/Core/Trace2StreamWriter.cs | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/shared/Core/ITrace2Writer.cs b/src/shared/Core/ITrace2Writer.cs index 6dd302add..fbe1b2297 100644 --- a/src/shared/Core/ITrace2Writer.cs +++ b/src/shared/Core/ITrace2Writer.cs @@ -3,6 +3,16 @@ namespace GitCredentialManager; +/// +/// The different format targets supported in the TRACE2 tracing +/// system. +/// +public enum Trace2FormatTarget +{ + Event, + Normal +} + public interface ITrace2Writer : IDisposable { bool Failed { get; } diff --git a/src/shared/Core/Trace2StreamWriter.cs b/src/shared/Core/Trace2StreamWriter.cs index 5ef88bd1b..c41f45ec8 100644 --- a/src/shared/Core/Trace2StreamWriter.cs +++ b/src/shared/Core/Trace2StreamWriter.cs @@ -3,16 +3,6 @@ namespace GitCredentialManager; -/// -/// The different format targets supported in the TRACE2 tracing -/// system. -/// -public enum Trace2FormatTarget -{ - Event, - Normal -} - public class Trace2StreamWriter : Trace2Writer { private readonly TextWriter _writer; From 7c9328c8e035917f1cfd7ff11d465989f911e99d Mon Sep 17 00:00:00 2001 From: Lessley Dennington Date: Tue, 14 Mar 2023 09:40:50 -0600 Subject: [PATCH 2/4] trace2: write normal format events in snake case A previous patch [1] added the ability to write strings in snake case. However, this was not applied to writing events in the normal format - events that should be written as child_start or child_exit are currently written as childstart and childexit. This patch corrects this issue. [1]: 7d2a8cc583a8aeae104c6cb144fde1328ef50cae --- src/shared/Core/Trace2.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/Core/Trace2.cs b/src/shared/Core/Trace2.cs index 7ba44d3d2..6317654fe 100644 --- a/src/shared/Core/Trace2.cs +++ b/src/shared/Core/Trace2.cs @@ -467,7 +467,7 @@ protected string BuildNormalString(string message) // Git's TRACE2 normal format is: // [