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


C# LogLevel.CompareTo方法代码示例

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


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

示例1: checkFilter

 protected bool checkFilter(LogLevel level)
 {
     return (level.CompareTo(filter) < 0);
 }
开发者ID:seriesrenamer,项目名称:seriesrenamer,代码行数:4,代码来源:AbstractLogger.cs

示例2: TryWriteLogEntry

		/// <summary>
		/// Writes a log entry in the GWL stream if the level is greater than
		/// <code>MinimalLogLevel</code>
		/// </summary>
		/// <param name="level">Level of the log entry.</param>
		/// <param name="message">Message of the log entry.</param>
		/// <param name="engine">Engine instance used to geotag the log entry.</param>
		/// <returns>True if the log entry's level was above or equal to the minimal required
		/// level and the entry was successfully written on the stream, false otherwise.</returns>
		public bool TryWriteLogEntry(LogLevel level, string message, Engine engine)
		{
			// Checks if the entry is allowed to be displayed at all.
			if (level.CompareTo(MinimalLogLevel) < 0)
			{
				return false;
			}

			// Tries to write the message.
			try
			{
				_writer.WriteLine(engine.CreateLogMessage(message));

				return true;
			}
			catch (Exception)
			{
				return false;
			}
		}
开发者ID:chier01,项目名称:WF.Player.Core,代码行数:29,代码来源:GWL.cs

示例3: Write

    /// <summary>
    /// Writes the specified level logs.
    /// </summary>
    /// <param name="level">The level.</param>
    /// <param name="message">The message.</param>
    private void Write(LogLevel level, string message)
    {
      if (level.CompareTo(_appSettingLogLevel) < 0) return;
      if (_writer == null) return;
      if (string.IsNullOrWhiteSpace(message)) return;

      Write(new LogEntry(
          message,
          DateTime.Now.ToString(@"yyyy-MM-dd HH:mm:ss.ffffff", CultureInfo.InvariantCulture),
          Thread.CurrentThread.ManagedThreadId.ToString("000", CultureInfo.InvariantCulture),
          level));
    }
开发者ID:sclcwwl,项目名称:Gimela,代码行数:17,代码来源:FileLogger.cs


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