本文整理汇总了C#中TraceEventType类的典型用法代码示例。如果您正苦于以下问题:C# TraceEventType类的具体用法?C# TraceEventType怎么用?C# TraceEventType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TraceEventType类属于命名空间,在下文中一共展示了TraceEventType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TraceEvent
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
{
if ((this.Filter == null) || this.Filter.ShouldTrace(eventCache, source, eventType, id, message, null, null, null))
{
this.WriteLine(message);
}
}
开发者ID:kzu,项目名称:OctoFlow,代码行数:7,代码来源:SimpleConsoleListener.cs
示例2: ToStockSharp
private static LogLevels? ToStockSharp(TraceEventType eventType)
{
switch (eventType)
{
case TraceEventType.Critical:
case TraceEventType.Error:
return LogLevels.Error;
case TraceEventType.Warning:
return LogLevels.Warning;
case TraceEventType.Information:
return LogLevels.Info;
case TraceEventType.Verbose:
return LogLevels.Debug;
case TraceEventType.Start:
case TraceEventType.Stop:
case TraceEventType.Suspend:
case TraceEventType.Resume:
case TraceEventType.Transfer:
return null;
default:
throw new ArgumentOutOfRangeException("eventType");
}
}
开发者ID:yadrewn,项目名称:StockSharpShared_Before2016_05_25,代码行数:27,代码来源:TraceSource.cs
示例3: DefaultGetLogLevel
static Level DefaultGetLogLevel(TraceEventType traceEventType)
{
switch (traceEventType)
{
case TraceEventType.Critical:
return Level.Fatal;
case TraceEventType.Error:
return Level.Error;
case TraceEventType.Warning:
return Level.Warn;
case TraceEventType.Information:
return Level.Info;
case TraceEventType.Verbose:
return Level.Trace;
case TraceEventType.Start:
return Level.Debug;
case TraceEventType.Stop:
return Level.Debug;
case TraceEventType.Suspend:
return Level.Debug;
case TraceEventType.Resume:
return Level.Debug;
case TraceEventType.Transfer:
return Level.Debug;
default:
throw new ArgumentOutOfRangeException("traceEventType");
}
}
开发者ID:mirrobozik,项目名称:MB.Owin.Logging.Log4Net,代码行数:28,代码来源:Log4NetLogFactory.cs
示例4: DefaultIsLogEventEnabled
protected static bool DefaultIsLogEventEnabled(ILog commonLog, TraceEventType traceEventType)
{
switch (traceEventType)
{
case TraceEventType.Critical:
return commonLog.IsFatalEnabled;
case TraceEventType.Error:
return commonLog.IsErrorEnabled;
case TraceEventType.Warning:
return commonLog.IsWarnEnabled;
case TraceEventType.Information:
return commonLog.IsInfoEnabled;
case TraceEventType.Verbose:
return commonLog.IsTraceEnabled;
case TraceEventType.Start:
return commonLog.IsDebugEnabled;
case TraceEventType.Stop:
return commonLog.IsDebugEnabled;
case TraceEventType.Suspend:
return commonLog.IsDebugEnabled;
case TraceEventType.Resume:
return commonLog.IsDebugEnabled;
case TraceEventType.Transfer:
return commonLog.IsDebugEnabled;
default:
throw new ArgumentOutOfRangeException("traceEventType");
}
}
开发者ID:richarddbarnett,项目名称:Owin.Logging.Common,代码行数:28,代码来源:CommonLoggingFactory.cs
示例5: Log
public void Log(string message, TraceEventType eventType)
{
foreach (ILogger logger in this.loggers)
{
logger.Log(message, eventType);
}
}
开发者ID:grldsndrs,项目名称:Unity-3---Hands-on-Labs,代码行数:7,代码来源:CompositeLogger.cs
示例6: Map
private LogLevel Map(TraceEventType eventType)
{
switch (eventType)
{
case TraceEventType.Critical:
return LogLevel.Fatal;
case TraceEventType.Error:
return LogLevel.Error;
case TraceEventType.Warning:
return LogLevel.Warn;
case TraceEventType.Information:
return LogLevel.Info;
case TraceEventType.Verbose:
return LogLevel.Trace;
case TraceEventType.Start:
return LogLevel.Info;
case TraceEventType.Stop:
return LogLevel.Info;
case TraceEventType.Suspend:
return LogLevel.Info;
case TraceEventType.Resume:
return LogLevel.Info;
case TraceEventType.Transfer:
return LogLevel.Info;
default:
throw new ArgumentOutOfRangeException("eventType");
}
}
开发者ID:ryanmar,项目名称:IdentityServer3.Admin,代码行数:28,代码来源:LibLogLoggerFactory.cs
示例7: Trace
void Trace(TraceEventType eventType, string message)
{
if (this.Switch.ShouldTrace(eventType) && this.Listeners != null)
{
TraceEvent(eventType, 0, m_header + message);
}
}
开发者ID:Fulborg,项目名称:dwarrowdelf,代码行数:7,代码来源:MyTraceSource.cs
示例8: ShouldTrace
/// <summary>
/// Determines whether a filter is attached to this listener and, if so, asks whether it ShouldTrace applies to this data.
/// </summary>
protected virtual bool ShouldTrace(TraceEventCache eventCache, string source, TraceEventType eventType, int id,
string formatOrMessage, object[] args, object data1, object[] data)
{
return
!(Filter != null &&
!Filter.ShouldTrace(eventCache, source, eventType, id, formatOrMessage, args, data1, data));
}
开发者ID:Zoumaho,项目名称:Backload,代码行数:10,代码来源:CustomTraceListener.cs
示例9: TryGetValue
/// <summary>
/// Returns the value of Environment.MachineName
/// </summary>
/// <param name="value">The output parameter</param>
/// <param name="cache">Unused</param>
/// <param name="source">Unused</param>
/// <param name="eventType">Unused</param>
/// <param name="id">Unused</param>
/// <param name="formatOrMessage">Unused</param>
/// <param name="data">Unused</param>
/// <returns>True</returns>
public override bool TryGetValue(out object value, TraceEventCache cache, string source,
TraceEventType eventType, int id, string formatOrMessage,
object[] data)
{
value = Environment.MachineName;
return true;
}
开发者ID:Balansir,项目名称:Backload,代码行数:18,代码来源:MachineNamePropertyReader.cs
示例10: TraceEvent
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id)
{
this.source = source;
this.eventType = eventType;
this.id = id;
TraceEvent(eventCache, source, eventType, id, "No additional information.");
}
开发者ID:yong-ja,项目名称:starodyssey,代码行数:7,代码来源:ConsoleTraceListener.cs
示例11: DebugConsoleMessageEventArgs
public DebugConsoleMessageEventArgs(DateTime timestamp, string message, TraceEventType level, string source)
{
Timestamp = timestamp;
Message = message;
Level = level;
Source = source;
}
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:7,代码来源:DebugConsoleMessageEventArgs.cs
示例12: TraceEvent
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id)
{
if (_enabled)
{
WebSocketHost.Send($"{eventType}:{id} - {source}");
}
}
开发者ID:JayBeavers,项目名称:WebSocketTraceListener,代码行数:7,代码来源:WebTraceListener.cs
示例13: Trace
private void Trace(TraceEventType type, string message, params object[] parameters)
{
if (category.Source.Switch.ShouldTrace(type))
{
category.Source.TraceEvent(type, EVENT_ID, message, parameters);
}
}
开发者ID:abisteknoloji,项目名称:dotnet-cas-client,代码行数:7,代码来源:Logger.cs
示例14: TraceData
public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id,
params object[] data)
{
if (this.Filter != null &&
!this.Filter.ShouldTrace(eventCache, source, eventType, id, string.Empty, null, null, null))
return;
foreach (object obj in data)
{
if (obj is XPathNavigator)
{
using (var reader = ((XPathNavigator)obj).ReadSubtree())
{
reader.MoveToContent();
if (reader.IsStartElement())
Console.WriteLine(XElement.ReadFrom(reader).ToString(SaveOptions.OmitDuplicateNamespaces));
else
{
Console.WriteLine("Unable to write Xml data.");
}
}
}
else
{
Console.WriteLine(obj.ToString());
}
}
}
开发者ID:abclassic,项目名称:LBi.LostDoc,代码行数:28,代码来源:ConsolidatedConsoleTraceListener.cs
示例15: GetLogLevel
private static EventLevel GetLogLevel(TraceEventType traceEventType)
{
switch (traceEventType)
{
case TraceEventType.Critical:
return EventLevel.Critical;
case TraceEventType.Error:
return EventLevel.Error;
case TraceEventType.Warning:
return EventLevel.Warning;
case TraceEventType.Information:
return EventLevel.Informational;
case TraceEventType.Verbose:
case TraceEventType.Start:
case TraceEventType.Stop:
case TraceEventType.Suspend:
case TraceEventType.Resume:
case TraceEventType.Transfer:
return EventLevel.Verbose;
default:
throw new ArgumentOutOfRangeException(nameof(traceEventType));
}
}
开发者ID:SimpleInt,项目名称:SimpleInt,代码行数:28,代码来源:SinLogFactory.cs
示例16: TraceEvent
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id)
{
var te = new TraceEvent {Cache = eventCache, Source = source, Type = eventType, Id = id};
Events.Add(te);
if (OnEventAdd != null)
OnEventAdd.Invoke(te);
}
开发者ID:BastienDurel,项目名称:OCTGN,代码行数:7,代码来源:CacheTraceListener.cs
示例17: MyLoggingExceptionHandler
internal MyLoggingExceptionHandler(string logCategory, int eventId, TraceEventType severity, string title, int priority,
Type formatterType, LogWriter writer, DocumentModel doc)
: base(logCategory, eventId, severity, title, priority, formatterType, writer)
{
this.m_Writer = writer;
this.doc = doc;
}
开发者ID:NMO13,项目名称:SolidTurn,代码行数:7,代码来源:ExceptionSupport.cs
示例18: TraceData
public override sealed void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, params object[] data)
{
if ((base.Filter == null) || base.Filter.ShouldTrace(eventCache, source, eventType, id, null, null, null, data))
{
WriteTrace(eventCache, source, eventType, id, null, null, data);
}
}
开发者ID:Myslik,项目名称:PugTrace,代码行数:7,代码来源:TraceListenerBase.cs
示例19: LogLevel
LogLevel(string name, int index, SourceLevels sourceLevel, TraceEventType traceEventType)
{
Name = name;
_index = index;
SourceLevel = sourceLevel;
TraceEventType = traceEventType;
}
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:7,代码来源:LogLevel.cs
示例20: TraceEvent
public override sealed void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
{
if ((base.Filter == null) || base.Filter.ShouldTrace(eventCache, source, eventType, id, message, null, null, null))
{
WriteTrace(eventCache, source, eventType, id, message, null, null);
}
}
开发者ID:Myslik,项目名称:PugTrace,代码行数:7,代码来源:TraceListenerBase.cs
注:本文中的TraceEventType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论