本文整理汇总了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");
}
示例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();
}
示例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());
}
示例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");
}
}
示例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");
}
示例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");
}