示例#1
0
        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();
            }
        }
示例#2
0
        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
            };
        }