コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LogEntry"/> class.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <param name="severity">The severity.</param>
 /// <param name="source">The source.</param>
 public LogEntry(string text, LogEntrySeverity severity, LogEntrySource source)
 {
     this.logText  = text;
     this.logStamp = DateTime.Now;
     this.Severity = severity;
     this.Source   = source;
 }
コード例 #2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="LogEntry" /> class.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <param name="severity">The severity.</param>
 /// <param name="source">The source.</param>
 /// <param name="path">The path where something happened</param>
 public LogEntry(string text, LogEntrySeverity severity, LogEntrySource source, string path)
 {
     LogText = text;
     LogStamp = DateTime.Now;
     Severity = severity;
     Source = source;
     Path = path;
 }
コード例 #3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="LogEntry" /> class.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <param name="severity">The severity.</param>
 /// <param name="source">The source.</param>
 /// <param name="path">The path where something happened</param>
 public LogEntry(string text, LogEntrySeverity severity, LogEntrySource source, string path)
 {
     LogText  = text;
     LogStamp = DateTime.Now;
     Severity = severity;
     Source   = source;
     Path     = path;
 }
コード例 #4
0
 public LogEntry(string message, LogEntryType type, LogEntrySource sourceName, string extraSourceInfo)
 {
     Message         = message;
     SourceName      = sourceName;
     ExtraSourceInfo = extraSourceInfo;
     Type            = type;
     Date            = DateTime.Now;
 }
コード例 #5
0
        public static void Write(string message, LogEntryType type, LogEntrySource source, string extraSourceInfo)
        {
            var newEntry = new LogEntry(message, type, source, extraSourceInfo);

            lock (LogEntryBackingList)
            {
                LogEntryBackingList.Add(newEntry);
                TrimLogList();
            }
            OnEntryAdded(newEntry);
        }
コード例 #6
0
        /// <summary>
        /// Logs the specified text. This is marshalled to the UI thread if necessary.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="severity">The severity.</param>
        /// <param name="source">The source.</param>
        private void Log(string text, LogEntrySeverity severity, LogEntrySource source)
        {
            if (String.IsNullOrEmpty(text))
            {
                return;
            }

            this.MarshallMethod(() =>
            {
                //Hack to catch error messages from the converter
                if (text.StartsWith("Error: "))
                {
                    this.Options.Logger.AddLogEntry(new LogEntry(text, LogEntrySeverity.Error, LogEntrySource.Converter));
                    return;
                }

                this.Options.Logger.AddLogEntry(new LogEntry(text, severity, source));
            }, DispatcherPriority.Send);
        }
コード例 #7
0
ファイル: AppLog.cs プロジェクト: Klocman/MSREG
 public LogEntry(string message, LogEntryType type, LogEntrySource sourceName, string extraSourceInfo)
 {
     Message = message;
     SourceName = sourceName;
     ExtraSourceInfo = extraSourceInfo;
     Type = type;
     Date = DateTime.Now;
 }
コード例 #8
0
ファイル: AppLog.cs プロジェクト: Klocman/MSREG
 public static void Write(string message, LogEntryType type, LogEntrySource source)
 {
     Write(message, type, source, string.Empty);
 }
コード例 #9
0
ファイル: AppLog.cs プロジェクト: Klocman/MSREG
 public static void Write(string message, LogEntryType type, LogEntrySource source, string extraSourceInfo)
 {
     var newEntry = new LogEntry(message, type, source, extraSourceInfo);
     lock (LogEntryList)
     {
         LogEntryList.Add(newEntry);
         TrimLogList();
     }
     OnEntryAdded(newEntry);
 }
コード例 #10
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="LogEntry" /> class.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <param name="severity">The severity.</param>
 /// <param name="source">The source.</param>
 public LogEntry(string text, LogEntrySeverity severity, LogEntrySource source)
     : this(text, severity, source, string.Empty)
 {
 }
コード例 #11
0
 public static void Write(string message, LogEntryType type, LogEntrySource source)
 {
     Write(message, type, source, string.Empty);
 }
コード例 #12
0
        /// <summary>
        /// Logs the specified text. This is marshalled to the UI thread if necessary.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="severity">The severity.</param>
        /// <param name="source">The source.</param>
        private void Log(string text, LogEntrySeverity severity, LogEntrySource source)
        {
            if (String.IsNullOrEmpty(text))
            {
                return;
            }

            this.MarshallMethod(() =>
                {
                    //Hack to catch error messages from the converter
                    if (text.StartsWith("Error: "))
                    {
                        this.Options.Logger.AddLogEntry(new LogEntry(text, LogEntrySeverity.Error, LogEntrySource.Converter));
                        return;
                    }

                    this.Options.Logger.AddLogEntry(new LogEntry(text, severity, source));
                }, DispatcherPriority.Send);
        }
コード例 #13
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="LogEntry" /> class.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <param name="severity">The severity.</param>
 /// <param name="source">The source.</param>
 public LogEntry(string text, LogEntrySeverity severity, LogEntrySource source)
     : this(text, severity, source, string.Empty)
 {
 }