protected virtual void LogInvoke <T>(InvokeResult <T> result, InvokeFunctionLogSettings operationLogSettings) { if (result == null) { return; } switch (operationLogSettings.LogInvokeResult) { case LogInvokeResult.Always: _logger.Log(operationLogSettings.LogLevel, "{@result}", result); break; case LogInvokeResult.IsFail: if (!result.IsSuccess) { _logger.Log(operationLogSettings.LogLevel, "{@result}", result); } break; default: throw new ArgumentOutOfRangeException(); } }
public InvokeResultSettings() { ValidationLogSettings = new OperationLogSettings { IsLogging = true, LogLevel = LogLevel.Debug }; LogRequestLogSettings = new OperationLogSettings { IsLogging = true, LogLevel = LogLevel.Debug }; InvokeFunctionLogSettings = new InvokeFunctionLogSettings { LogInvokeResult = LogInvokeResult.IsFail, LogLevel = LogLevel.Debug }; }