当前位置: 首页>>代码示例>>C#>>正文


C# ILogger.DebugFormat方法代码示例

本文整理汇总了C#中ILogger.DebugFormat方法的典型用法代码示例。如果您正苦于以下问题:C# ILogger.DebugFormat方法的具体用法?C# ILogger.DebugFormat怎么用?C# ILogger.DebugFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILogger的用法示例。


在下文中一共展示了ILogger.DebugFormat方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExitMethod

 public void ExitMethod(ILogger logger, MethodBase currentMethod)
 {
     if (logger.IsDebugEnabled)
     {
         logger.DebugFormat("EXIT {0}.{1} ", currentMethod.DeclaringType.FullName, currentMethod.Name);
     }
 }
开发者ID:MikeJansen,项目名称:CrowSoftware.Lib,代码行数:7,代码来源:LogManager.cs

示例2: HandleUnknownOperationCode

        public static OperationResponse HandleUnknownOperationCode(OperationRequest operationRequest, ILogger logger)
        {
            if (logger != null && logger.IsDebugEnabled)
            {
                logger.DebugFormat("Unknown operation code: OpCode={0}", operationRequest.OperationCode);
            }

            return new OperationResponse { OperationCode = operationRequest.OperationCode, ReturnCode = (int)ErrorCode.OperationInvalid, DebugMessage = "Invalid operation code" };
        }
开发者ID:azanium,项目名称:PopBloop-GameServer,代码行数:9,代码来源:OperationHelper.cs

示例3: HandleInvalidOperation

        public static OperationResponse HandleInvalidOperation(Operation operation, ILogger logger)
        {
            string errorMessage = operation.GetErrorMessage();

            if (logger != null && logger.IsDebugEnabled)
            {
                logger.DebugFormat("Invalid operation: OpCode={0}; {1}", operation.OperationRequest.OperationCode, errorMessage);
            }

            return new OperationResponse { OperationCode = operation.OperationRequest.OperationCode, ReturnCode = (int)ErrorCode.OperationInvalid, DebugMessage = errorMessage };
        }
开发者ID:azanium,项目名称:PopBloop-GameServer,代码行数:11,代码来源:OperationHelper.cs

示例4: EnquiryFactory

        public EnquiryFactory(ILogger logger, IEnumerable<IntegrationSystemConfigurationPoco> systemConfigs)
        {
            Logger = logger;
            SystemConfigs = systemConfigs;

            // set the configs
            EnquiryEndPoint = SystemConfigs.GetValue(InfrastructureConstants.SiebelCustomerEnquiryEndpoint);
            EnquiryUserId = SystemConfigs.GetValue(InfrastructureConstants.SiebelCustomerEnquiryUserId);
            EnquiryPassword = SystemConfigs.GetValue(InfrastructureConstants.SiebelCustomerEnquiryPassword);
            EnquiryTimeout = Int32.Parse(SystemConfigs.GetValue(InfrastructureConstants.SiebelCustomerEnquiryTimeout));
            EnquiryMethod = SystemConfigs.GetValue(InfrastructureConstants.SiebelCustomerEnquiryMethod);

            Logger.DebugFormat("EnquiryFactory created with configuration values EnquiryEndPoint: {0}; EnquiryUserId: {1}; EnquiryPassword: {2}; EnquiryTimeout: {3}; EnquiryMethod: {4}.", EnquiryEndPoint, EnquiryUserId, EnquiryPassword, EnquiryTimeout, EnquiryMethod);
        }
开发者ID:jaswalsukhi,项目名称:Iheik,代码行数:14,代码来源:EnquiryFactory.cs

示例5: UnityWebResponseData

        /// <summary>
        /// The constructor for UnityWebResponseData.
        /// </summary>
        /// <param name="wwwRequest">
        /// An instance of WWW after the web request has 
        /// completed and response fields are set
        /// </param>
        public UnityWebResponseData(WWW wwwRequest)
        {
            _logger= Logger.GetLogger(this.GetType());
            _headers = wwwRequest.responseHeaders;
            try
            {
                _responseBody = wwwRequest.bytes;
            }
            catch (Exception)
            {
                _logger.DebugFormat(@"setting response body to null");
                _responseBody = null;
            }

            if (wwwRequest.error == null)
            {
                _logger.DebugFormat(@"recieved successful response");
            }
            else
            {
                _logger.DebugFormat(@"recieved error response");
                _logger.DebugFormat(@"recieved = {0}", wwwRequest.error);
            }

            if ((_responseBody != null && _responseBody.Length > 0) || (_responseBody.Length == 0 && wwwRequest.error == null))
            {
                _logger.DebugFormat(@"{0}", System.Text.UTF8Encoding.UTF8.GetString(_responseBody));
                _responseStream = new MemoryStream(_responseBody);
            }

            this.ContentLength = wwwRequest.bytesDownloaded;

            string contentType = null;
            this._headers.TryGetValue(
                HeaderKeys.ContentTypeHeader.ToUpperInvariant(), out contentType);
            this.ContentType = contentType;
            try
            {
                if(string.IsNullOrEmpty(wwwRequest.error))
                {
                    string statusHeader = string.Empty;
                    this._headers.TryGetValue(HeaderKeys.StatusHeader.ToUpperInvariant(),out statusHeader);
                    if(!string.IsNullOrEmpty(statusHeader))
                    {
                        this.StatusCode = (HttpStatusCode)Enum.Parse(
                        typeof(HttpStatusCode),
                        statusHeader.Substring(9, 3).Trim());
                    }
                    else
                    {
                        this.StatusCode = 0;
                    }
                }
                else
                {
                    int statusCode;
                    if (Int32.TryParse(wwwRequest.error.Substring(0,3), out statusCode))
                        this.StatusCode =  (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode),
                                            wwwRequest.error.Substring(3).Replace(" ", "").Replace(":","").Trim(),true);//ignored case
                    else
                        this.StatusCode = 0;
                }
            }
            catch
            {
                this.StatusCode = 0;
            }
            _logger.DebugFormat(@"Status = {0}", StatusCode);
            this.IsSuccessStatusCode = wwwRequest.error == null?true:false;
        }
开发者ID:NathanSDunn,项目名称:aws-sdk-unity,代码行数:77,代码来源:UnityWebResponseData.cs

示例6: ProcessResult

 public void ProcessResult(RawMessage message, ITransport transport, ILogger log)
 {
     log.DebugFormat("Delaying message {0} until {1}", message.ToString(), this.DelayUntil.ToString());
     message.DelayUntil = this.DelayUntil;
     transport.SendToDelay(message);
 }
开发者ID:WaveServiceBus,项目名称:WaveServiceBus,代码行数:6,代码来源:DelayResult.cs

示例7: ProcessResult

 public void ProcessResult(RawMessage message, ITransport transport, ILogger log)
 {
     log.DebugFormat("Message {0} ignored for reason {1}", message.ToString(), this.reason);
 }
开发者ID:WaveServiceBus,项目名称:WaveServiceBus,代码行数:4,代码来源:IgnoreResult.cs

示例8: Process

        public void Process()
        {
            try
            {
                _logger = _container.Resolve<ILogger>();
            }
            catch
            {
            }

            try
            {
                if (_logger.IsDebugEnabled)
                    _logger.DebugFormat("Begin async process for request coming from {0}...", IncomingUri);

                var operationFactory = _container.Resolve<IRemoraOperationFactory>();
                var kindIdentifier = _container.Resolve<IRemoraOperationKindIdentifier>();
                var pipelineFactory = _container.Resolve<IPipelineFactory>();
                var pipelineEngine = _container.Resolve<IPipelineEngine>();

                IRemoraOperation operation = null;
                switch (_kind)
                {
                    case ContextKind.Web:
                        operation = operationFactory.Get(new UniversalRequest(HttpWebContext.Request));
                        operation.ExecutionProperties[ContextKey] = HttpWebContext;
                        break;
                    case ContextKind.Net:
                        operation = operationFactory.Get(new UniversalRequest(HttpListenerContext.Request));
                        operation.ExecutionProperties[ContextKey] = HttpListenerContext;
                        break;
                }

                operation.Kind = kindIdentifier.Identify(operation);
                var pipeline = pipelineFactory.Get(operation);

                if (pipeline == null)
                    throw new InvalidConfigurationException(
                        string.Format("Unable to select an appropriate pipeline for operation {0}.", operation));

                pipelineEngine.RunAsync(operation, pipeline, EngineCallback);
            }
            catch (Exception ex)
            {
                _logger.ErrorFormat(ex, "There has been an error when processing request coming from {0}.", IncomingUri);

                WriteGenericException(ex);
                IsCompleted = true;
                _callback(this);
            }
        }
开发者ID:julienblin,项目名称:Remora,代码行数:51,代码来源:RemoraAsyncProcessor.cs

示例9: ShowPPDTrace

        public void ShowPPDTrace(ILogger logger, string slotName, SlotStatus status, PpdCalculationType calculationType, BonusCalculationType calculateBonus)
        {
            // test the level
             if (!logger.IsDebugEnabled) return;

             if (CurrentProtein.IsUnknown())
             {
            logger.DebugFormat(Constants.ClientNameFormat, slotName, "Protein is unknown... 0 PPD.");
            return;
             }

             // Issue 125
             if (calculateBonus.Equals(BonusCalculationType.DownloadTime))
             {
            // Issue 183
            if (status.Equals(SlotStatus.RunningAsync) ||
                status.Equals(SlotStatus.RunningNoFrameTimes))
            {
               logger.DebugFormat(Constants.ClientNameFormat, slotName, "Calculate Bonus PPD by Frame Time.");
            }
            else
            {
               logger.DebugFormat(Constants.ClientNameFormat, slotName, "Calculate Bonus PPD by Download Time.");
            }
             }
             else if (calculateBonus.Equals(BonusCalculationType.FrameTime))
             {
            logger.DebugFormat(Constants.ClientNameFormat, slotName, "Calculate Bonus PPD by Frame Time.");
             }
             else
             {
            logger.DebugFormat(Constants.ClientNameFormat, slotName, "Calculate Standard PPD.");
             }

             TimeSpan frameTime = GetFrameTime(calculationType);
             var values = CurrentProtein.GetProductionValues(frameTime, GetEftByDownloadTime(frameTime), GetEftByFrameTime(frameTime), calculateBonus.IsEnabled());
             logger.Debug(values.ToMultiLineString());
        }
开发者ID:kszysiu,项目名称:hfm-net,代码行数:38,代码来源:UnitInfoLogic.cs


注:本文中的ILogger.DebugFormat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。