Skip to content

Commit

Permalink
Clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Sep 7, 2024
1 parent 5b33be8 commit 76e07cc
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions src/Buildalyzer/BuildTracer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Collections.Concurrent;
using System.IO;
using System.Runtime.CompilerServices;
using Buildalyzer.IO;
using Microsoft.Build.Framework;

Expand Down Expand Up @@ -41,19 +39,16 @@ public BuildTracer(IEventSource eventSource)
private void TaskStarted(object? sender, TaskStartedEventArgs e)
{
Events.Add(e);
Log(e);
}

private void TargetStarted(object? sender, TargetStartedEventArgs e)
{
Events.Add(e);
Log(e);
}

private void TargetFinished(object? sender, TargetFinishedEventArgs e)
{
Events.Add(e);
Log(e);
}

private void ProjectStarted(object? sender, ProjectStartedEventArgs e)
Expand All @@ -67,8 +62,6 @@ private void ProjectStarted(object? sender, ProjectStartedEventArgs e)
Paths.Add(KeyValuePair.Create(e.BuildEventContext, path));
Properties.Add(KeyValuePair.Create(e.BuildEventContext, properties));
Items.Add(KeyValuePair.Create(e.BuildEventContext, items));

Log(e);
}

private void MessageRaised(object? sender, BuildMessageEventArgs e)
Expand All @@ -91,55 +84,41 @@ _ when e.SenderName.IsMatch("Fsc") => Compiler.CommandLine.Parse(dir, e.Message,
{
Commands.Add(KeyValuePair.Create(e.BuildEventContext, command));
}
Log(e);
}

private void StatusEventRaised(object? sender, BuildStatusEventArgs e)
{
Events.Add(e);
Log(e);
}

private void BuildStarted(object? sender, BuildStartedEventArgs e)
{
Events.Add(e);
Log(e);
}

private void ErrorRaised(object? sender, BuildErrorEventArgs e)
{
Events.Add(e);
Log(e);
}

private void CustomEventRaised(object? sender, CustomBuildEventArgs e)
{
Events.Add(e);
Log(e);
}

private void TaskFinished(object? sender, TaskFinishedEventArgs e)
{
Events.Add(e);
Log(e);
}

private void ProjectFinished(object? sender, ProjectFinishedEventArgs e)
{
Events.Add(e);
Log(e);
}

private void BuildFinished(object? sender, BuildFinishedEventArgs e)
{
Events.Add(e);
Log(e);
}

private static void Log(object obj, [CallerMemberName] string? paramName = null)
{
//var json = System.Text.Json.JsonSerializer.Serialize(obj, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });
Console.WriteLine($"{DateTime.Now:HH:mm:ss.fff}: {paramName}");
}

public void Dispose()
Expand All @@ -163,5 +142,6 @@ public void Dispose()
Disposed = true;
}
}

private bool Disposed;
}

0 comments on commit 76e07cc

Please sign in to comment.