// Creates a scope based on the non-null values passed in. Allows us to test various permutations and make sure that the logger handles them. private IDisposable CreateScope(string functionName = null, string activityId = null, string functionInvocationId = null) { var scope = new Dictionary <string, object>(); if (functionName != null) { scope[ScopeKeys.FunctionName] = functionName; } if (activityId != null) { scope[ScriptConstants.LogPropertyActivityIdKey] = activityId; } if (functionInvocationId != null) { scope[ScopeKeys.FunctionInvocationId] = functionInvocationId; } return(_logger?.BeginScope(scope)); }