Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Nov 20, 2020
1 parent b113c50 commit 10bc6a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/DiffEngineTray/Tracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public TrackedMove AddMove(
bool canKill,
int? processId)
{
var exeFile = Path.GetFileName(exe);
var targetFile = Path.GetFileName(target);
return moves.AddOrUpdate(
target,
addValueFactory: key =>
Expand All @@ -116,7 +118,7 @@ public TrackedMove AddMove(

var solutionName = SolutionDirectoryFinder.Find(key);

Log.Information("MoveAdded. Target:{target}, CanKill:{canKill}, ProcessId:{processId}, CommandLine:{commandLine}", target, canKill, processId, $"{exe} {arguments}");
Log.Information("MoveAdded. Target:{target}, CanKill:{canKill}, ProcessId:{processId}, CommandLine:{commandLine}", targetFile, canKill, processId, $"{exeFile} {arguments}");
return new TrackedMove(temp, key, exe, arguments, canKill, process, solutionName);
},
updateValueFactory: (key, existing) =>
Expand All @@ -133,7 +135,7 @@ public TrackedMove AddMove(
}

var solutionName = SolutionDirectoryFinder.Find(key);
Log.Information("MoveUpdated. Target:{target}, CanKill:{canKill}, ProcessId:{processId}, CommandLine:{commandLine}", target, canKill, processId, $"{exe} {arguments}");
Log.Information("MoveUpdated. Target:{target}, CanKill:{canKill}, ProcessId:{processId}, CommandLine:{commandLine}", targetFile, canKill, processId, $"{exeFile} {arguments}");
return new TrackedMove(temp, key, exe, arguments, canKill, process, solutionName);
});
}
Expand Down Expand Up @@ -207,13 +209,13 @@ static void KillProcesses(TrackedMove move)
{
if (!move.CanKill)
{
Log.Information($"Did not kill for `{move.Temp}` since CanKill=false");
Log.Information($"Did not kill for `{move.Name}` since CanKill=false");
return;
}

if (move.Process == null)
{
Log.Information($"No processes to kill for `{move.Temp}`");
Log.Information($"No processes to kill for `{move.Name}`");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<NoWarn>CS1591;CS0649</NoWarn>
<Version>6.4.3</Version>
<Version>6.4.34</Version>
<AssemblyVersion>1.0.0</AssemblyVersion>
<PackageTags>Testing, Snapshot, Diff, Compare</PackageTags>
<Description>Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.</Description>
Expand Down

0 comments on commit 10bc6a5

Please sign in to comment.