Skip to content

Commit

Permalink
Wrap diagnostic logging in debug conditional to avoid unnecessary str…
Browse files Browse the repository at this point in the history
…ing construction for unlogged messages in non-development environments (was notice while exploring options for using FeatureGate attribute from feature management library to disable controllers -- to no avail).
  • Loading branch information
gmcelhanon committed Jan 9, 2025
1 parent 12333b4 commit 1566151
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ public static IReadOnlyList<Cycle<TVertex>> GetCycles<TVertex, TEdge>(
// Call the recursive helper function to detect cycle in different DFS trees
foreach (var vertex in graph.Vertices)
{
_logger.Debug($"Probing node '{vertex}' for cyclical dependencies...");
if (_logger.IsDebugEnabled)
{
_logger.Debug($"Probing node '{vertex}' for cyclical dependencies...");
}

graph.FindCycles(vertex, visited, stack, cycles);
}

Expand Down

0 comments on commit 1566151

Please sign in to comment.