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


C# TraceEventType类代码示例

本文整理汇总了C#中TraceEventType的典型用法代码示例。如果您正苦于以下问题:C# TraceEventType类的具体用法?C# TraceEventType怎么用?C# TraceEventType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TraceEventType类属于命名空间,在下文中一共展示了TraceEventType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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