Fix CA1873: guard LogError with IsEnabled check in FoundryToolboxService

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
alliscode
2026-04-20 13:24:39 -07:00
Unverified
parent bbbb78b8df
commit 6c2e143192
@@ -111,10 +111,13 @@ public sealed class FoundryToolboxService : IHostedService, IAsyncDisposable
}
catch (Exception ex) when (ex is not OperationCanceledException)
{
this._logger.LogError(
ex,
"Failed to connect to toolbox '{ToolboxName}'. Tools from this toolbox will not be available.",
toolboxName);
if (this._logger.IsEnabled(LogLevel.Error))
{
this._logger.LogError(
ex,
"Failed to connect to toolbox '{ToolboxName}'. Tools from this toolbox will not be available.",
toolboxName);
}
}
}