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


C# LogEntryType类代码示例

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


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

示例1: LogEntry

 public LogEntry(DateTime logTime, string entryId, string message, LogEntryType type)
 {
     LogTime = logTime;
     EntryId = entryId;
     Message = message;
     Type = type;
 }
开发者ID:piscisaureus,项目名称:kudu,代码行数:7,代码来源:LogEntry.cs

示例2: GetLogEntries

 public static IEnumerable<LogEntry> GetLogEntries(LogEntryType filterLevel)
 {
     lock (LogEntryList)
     {
         return LogEntryList.Where(x => x.Type.CompareTo(filterLevel) >= 0).ToArray();
     }
 }
开发者ID:Klocman,项目名称:MSREG,代码行数:7,代码来源:AppLog.cs

示例3: WriteLine

        public void WriteLine(LogEntryType logEntryType, String message)
        {
            /* Timestamps are represented in the Round Trip Format Specifier
             (http://msdn.microsoft.com/en-us/library/az4se3k1.aspx#Roundtrip). */
              var timestamp = DateTime.Now.ToUniversalTime().ToString("o");

              String type;
              switch (logEntryType)
              {
            case LogEntryType.Info:
              type = "INF";
              break;
            case LogEntryType.Warning:
              type = "WRN";
              break;
            case LogEntryType.Error:
              type = "ERR";
              break;
            default:
              type = "UNK";
              break;
              }

              this._writer.WriteLine(String.Format("{0} - {1} - {2}", timestamp, type, message));
        }
开发者ID:ctimmons,项目名称:cs_utilities,代码行数:25,代码来源:Log.cs

示例4: LogEntry

 /// <summary>
 /// Initializes a new instance of LogEntry with username, message and log entry type.
 /// </summary>
 /// <param name="userName">Username who generated the log entry.</param>
 /// <param name="message">Message associated with the log entry.</param>
 /// <param name="entryType">Type of log entry.</param>
 public LogEntry(string userName, string message, LogEntryType entryType)
 {
     this._TimwGenerated = DateTime.Now;
     this._UserName = userName;
     this._Message = message;
     this._EntryType = entryType;
 }
开发者ID:kami-,项目名称:Prizet,代码行数:13,代码来源:LogEntry.cs

示例5: MonitorBinaryFileOutput

 void IActivityMonitorBoundClient.SetMonitor( IActivityMonitorImpl source, bool forceBuggyRemove )
 {
     if( source != null && _source != null ) throw ActivityMonitorClient.CreateMultipleRegisterOnBoundClientException( this );
     // Silently ignore null => null or monitor => same monitor.
     if( source != _source )
     {
         _prevLogType = LogEntryType.None;
         _prevlogTime = DateTimeStamp.Unknown;
         Debug.Assert( (source == null) != (_source == null) );
         if( (_source = source) == null )
         {
             if( _file != null ) _file.Close();
             _file = null;
         }
         else
         {
             // If initialization failed, we let the file null: this monitor will not
             // work (the error will appear in the Critical errors) but this avoids
             // an exception to be thrown here.
             var f = new MonitorBinaryFileOutput( _path, ((IUniqueId)_source).UniqueId, _maxCountPerFile, _useGzipCompression );
             if( f.Initialize( new SystemActivityMonitor( false, null ) ) )
             {
                 var g = _source.CurrentGroup;
                 _currentGroupDepth = g != null ? g.Depth : 0;
                 _file = f;
             }
         }
     }
 }
开发者ID:Invenietis,项目名称:ck-core,代码行数:29,代码来源:CKMonWriterClient.cs

示例6: ActivityLogEntry

 public ActivityLogEntry(string Message, long msTime)
 {
     m_Timestamp = DateTime.Now;
     m_Type = LogEntryType.Timing;
     m_Msg = Message;
     m_Ref = msTime;
 }
开发者ID:norrislabs,项目名称:EmergeStudio,代码行数:7,代码来源:ActivityLogEntry.cs

示例7: LogMessageToTextFile

        private static int LogMessageToTextFile(LogEntryType type, string message)
        {
            try
            {

                string logmsg = "----------------------------\r\n" + //separator for new log
                    "Local time: " + DateTime.Now.ToString() + "\r\n" + //local time
                    //summary info                
                    "Application Name: " + applicationName + "\r\n" +
                    "Log Type: " + type.ToString() + "\r\n" +
                    "Error Message:\r\n" + message + "\r\n";
                
                //allow error log to be encoded by local time
                string logFileName = string.Format(errorLogFileName, DateTime.Now);
                using (StreamWriter w = File.AppendText(logFileName))
                {
                    w.Write(logmsg);
                }

                return 0; //logged to local file
            }
            catch (Exception e)
            {
                //ignore errors, avoid infinite loop of trying to log errors
#if DEBUG
                System.Console.WriteLine(e.ToString());
                System.Diagnostics.Debug.WriteLine(e.ToString());
#endif

                return -1;
            }
        }
开发者ID:huguogang,项目名称:Modem.NET,代码行数:32,代码来源:MessageLog.cs

示例8: Log

 public static void Log(LogEntryType type, LogActionType action, string log, string metadata)
 {
     WriteLog($"LogEntryType: {type}\n" +
              $"LogActionType : {action}\n" +
              $"Log : {log}\n" +
              $"Metadata : {metadata}");
 }
开发者ID:AbabeiAndrei,项目名称:WProject,代码行数:7,代码来源:DiagnosticLogger.cs

示例9: LogEntry

 public LogEntry(DateTime logTime, string id, string message, LogEntryType type)
 {
     LogTime = logTime;
     Id = id;
     Message = message;
     Type = type;
 }
开发者ID:EmmaZhu,项目名称:azure-sdk-tools,代码行数:7,代码来源:LogEntry.cs

示例10: LogEntry

 internal LogEntry (LogEntryType type, string message, string details)
 {
     this.type = type;
     this.message = message;
     this.details = details;
     this.timestamp = DateTime.Now;
 }
开发者ID:rubenv,项目名称:tripod,代码行数:7,代码来源:Log.cs

示例11: LEMCLog

 public LEMCLog( Guid monitorId, int depth, DateTimeStamp previousLogTime, LogEntryType previousEntryType, string text, DateTimeStamp t, string fileName, int lineNumber, LogLevel l, CKTrait tags, CKExceptionData ex )
     : base( text, t, fileName, lineNumber, l, tags, ex )
 {
     _monitorId = monitorId;
     _depth = depth;
     _previousEntryType = previousEntryType;
     _previousLogTime = previousLogTime;
 }
开发者ID:Invenietis,项目名称:ck-core,代码行数:8,代码来源:LEMCLog.cs

示例12: LogEntry

 public LogEntry(TimeSpan loggedTotalWorldTime, ILoggable loggable, LogEntryType entryType, TimeSpan logEntryLifetime)
 {
     _loggedTotalWorldTime = loggedTotalWorldTime;
     _entryType = entryType;
     _title = loggable.Title;
     _details = loggable.Details.ToArray();
     _fadeHelper = new TimedLerpHelper(loggedTotalWorldTime + logEntryLifetime - Constants.LogRenderer.FadeDuration, Constants.LogRenderer.FadeDuration, 1f, 0f);
 }
开发者ID:tj-miller,项目名称:TextAdventure,代码行数:8,代码来源:LogEntry.cs

示例13: Custom

 public void Custom(LogEntryType type, string message, Exception exception = null)
 {
     lock (writeLock)
     {
         writer.WriteLine("{0}: {1}", type.ToString().ToUpper(), message);
         WriteException(exception);
     }
 }
开发者ID:yonglehou,项目名称:SharpRPC,代码行数:8,代码来源:FileLogger.cs

示例14: LEMCCloseGroup

 public LEMCCloseGroup( Guid monitorId, int depth, DateTimeStamp previousLogTime, LogEntryType previousEntryType, DateTimeStamp t, LogLevel level, IReadOnlyList<ActivityLogGroupConclusion> c )
     : base( t, level, c )
 {
     _monitorId = monitorId;
     _depth = depth;
     _previousEntryType = previousEntryType;
     _previousLogTime = previousLogTime;
 }
开发者ID:Invenietis,项目名称:ck-core,代码行数:8,代码来源:LEMCCloseGroup.cs

示例15: LogEntry

 /// <summary>
 /// Initializes a new instance of a log entry
 /// </summary>
 /// <param name="id">The unique id for this entry</param>
 /// <param name="type">The log entry type</param>
 /// <param name="message">The message to be logged</param>
 /// <param name="logTime">The log time.</param>
 /// <param name="exception">The exception information to be logged</param>
 public LogEntry(int id, LogEntryType type, string message, DateTime logTime, Exception exception = null)
 {
     Id = id;
     Type = type;
     Message = message;
     Exception = exception != null ? new ExceptionEntry(exception) : null;
     LogTime = logTime;
 }
开发者ID:ayezutov,项目名称:NDistribUnit,代码行数:16,代码来源:LogEntry.cs


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