Skip to content

Commit

Permalink
remove magic string, fix log formatting (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmrdavid authored Jan 10, 2023
1 parent 1fcb262 commit a5a8132
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DurableWorker/DurableController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal class DurableController
private readonly ILogger _logger;

private bool isExternalDFSdkEnabled { get; } =
PowerShellWorkerConfiguration.GetBoolean("ExternalDurablePowerShellSDK") ?? false;
PowerShellWorkerConfiguration.GetBoolean(Utils.ExternalDurableSdkEnvVariable) ?? false;

public DurableController(
DurableFunctionInfo durableDurableFunctionInfo,
Expand Down Expand Up @@ -81,7 +81,7 @@ private void tryEnablingExternalSDK()
else if (isExternalSdkLoaded)
{
// External SDK is in the session, but customer did not explicitly enable it. Report the potential of runtime errors.
_logger.Log(isUserOnlyLog: false, LogLevel.Error, String.Format(PowerShellWorkerStrings.PotentialDurableSDKClash, Utils.ExternalDurableSdkName));
_logger.Log(isUserOnlyLog: false, LogLevel.Error, String.Format(PowerShellWorkerStrings.PotentialDurableSDKClash, Utils.ExternalDurableSdkName, Utils.ExternalDurableSdkEnvVariable));
}
}

Expand Down
1 change: 1 addition & 0 deletions src/Utility/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ internal class Utils
internal const string ExternalDurableSdkName = "AzureFunctions.PowerShell.Durable.SDK";
internal const string IsOrchestrationFailureKey = "IsOrchestrationFailure";
internal const string TracePipelineObjectCmdlet = "Microsoft.Azure.Functions.PowerShellWorker\\Trace-PipelineObject";
internal const string ExternalDurableSdkEnvVariable = "ExternalDurablePowerShellSDK";

internal readonly static object BoxedTrue = (object)true;
internal readonly static object BoxedFalse = (object)false;
Expand Down

0 comments on commit a5a8132

Please sign in to comment.