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


C# ILog.TraceFormat方法代码示例

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


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

示例1: OutputSQL

 /// <summary>
 ///     Compiles the Context to execution of a query and tracks the time spent
 /// </summary>
 /// <param name="context">the context to run the test against</param>
 /// <param name="log">The log to output the information to</param>
 /// <param name="queries">the list of queries to be output</param>
 /// <exception cref="InvalidOperationException">
 ///     If the compilation does not meet the expected time, it will throw this
 ///     error
 /// </exception>
 public static void OutputSQL(this IDataContext context, ILog log, params IQueryBase[] queries)
 {
     log.TraceFormat("Beginning Sql Output");
     foreach (IQueryBase query in queries)
     {
         log.Trace("************************************************");
         log.TraceFormat("SQL Statement for {0}", query.GetType().Name);
         log.Trace("------------------------------------------------");
         query.OutputQuery(context);
         log.Trace("************************************************");
     }
     log.Trace("SQL Output Completed");
 }
开发者ID:joswalt,项目名称:Highway.Data,代码行数:23,代码来源:LoggingTraceExtensions.cs

示例2: ServerSupervisor

        public ServerSupervisor(IServerComponent component, ServerSupervisorOptions options)
        {
            if (component == null) throw new ArgumentNullException("component");
            if (options == null) throw new ArgumentNullException("options");

            _component = component;
            _options = options;

            _logger = LogManager.GetLogger(_component.GetType());
            _thread = new Thread(RunComponent) { IsBackground = true, Name = component.ToString() };

            _logger.TraceFormat("Starting a new thread for server component '{0}'...", _component);
            _thread.Start();
        }
开发者ID:jeeva-selvaganesh,项目名称:Hangfire,代码行数:14,代码来源:ServerSupervisor.cs

示例3: CancelHotmailRelatedJobs

        public static void CancelHotmailRelatedJobs(IJobRepository jobRepository, ILog logger, Campaign campaign, DateTime cutOffTime, Event dblogEvent)
        {
            var jobs = jobRepository.GetAll()
                          .Where(j => j.Template.creative_id == campaign.Template.creative_id
                                      && j.Template.fromName.Trim() == campaign.Template.fromName.Trim()
                                      && j.Template.emailSubject.Trim() == campaign.Template.emailSubject
                                      && !CancellationExcludedJobStatusIds.Contains(j.jobstatus_id)
                                      && j.deliverygroup_id.HasValue
                                      && j.DeliveryGroup.CancelOnBulkingEnabled
                                      && j.datelaunch < cutOffTime).ToArray();

            foreach (var j in jobs)
            {
                j.Cancel(jobRepository,dblogEvent);
                logger.TraceFormat("Cancelled Job {0} and its targets", j.job_id);
            }
            logger.InfoFormat("Cancelled {0} Jobs", jobs.Count());
        }
开发者ID:c0d3m0nky,项目名称:mty,代码行数:18,代码来源:Job.cs

示例4: DefaultWriteLogEvent

 protected static void DefaultWriteLogEvent(ILog commonLog, TraceEventType traceEventType, String message, Exception ex)
 {
     switch (traceEventType)
     {
         case TraceEventType.Critical:
             commonLog.FatalFormat(message, ex);
             break;
         case TraceEventType.Error:
             commonLog.ErrorFormat(message, ex);
             break;
         case TraceEventType.Warning:
             commonLog.WarnFormat(message, ex);
             break;
         case TraceEventType.Information:
             commonLog.InfoFormat(message, ex);
             break;
         case TraceEventType.Verbose:
             commonLog.TraceFormat(message, ex);
             break;
         case TraceEventType.Start:
             commonLog.DebugFormat(message, ex);
             break;
         case TraceEventType.Stop:
             commonLog.DebugFormat(message, ex);
             break;
         case TraceEventType.Suspend:
             commonLog.DebugFormat(message, ex);
             break;
         case TraceEventType.Resume:
             commonLog.DebugFormat(message, ex);
             break;
         case TraceEventType.Transfer:
             commonLog.DebugFormat(message, ex);
             break;
         default:
             throw new ArgumentOutOfRangeException("traceEventType");
     }
 }
开发者ID:richarddbarnett,项目名称:Owin.Logging.Common,代码行数:38,代码来源:CommonLoggingFactory.cs

示例5: CanLogMessageWithException

 protected virtual void CanLogMessageWithException(ILog log)
 {
     log.TraceFormat("Hi {0}", new ArithmeticException(), "dude");
     log.DebugFormat("Hi {0}", new ArithmeticException(), "dude");
     log.InfoFormat("Hi {0}", new ArithmeticException(), "dude");
     log.WarnFormat("Hi {0}", new ArithmeticException(), "dude");
     log.ErrorFormat("Hi {0}", new ArithmeticException(), "dude");
     log.FatalFormat("Hi {0}", new ArithmeticException(), "dude");
 }
开发者ID:briandealwis,项目名称:gt,代码行数:9,代码来源:AbstractSimpleLogTest.cs

示例6: CanLogMessage

 protected virtual void CanLogMessage(ILog log)
 {
     log.TraceFormat("Hi");
     log.Debug("Hi");
     log.Info("Hi");
     log.Warn("Hi");
     log.Error("Hi");
     log.Fatal("Hi");
 }
开发者ID:briandealwis,项目名称:gt,代码行数:9,代码来源:AbstractSimpleLogTest.cs


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