Пример #1
0
 /// <summary>
 /// Writes a debug entry into the log.
 /// </summary>
 public void WriteLine(DebugEntry entry)
 {
     if (MatchesFilter(entry.Category))
     {
         _entries.Add(entry);
         _delayingModule.Add(entry);
     }
 }
        public DebugListenerEventArgs(IDebugTraceListener listener, DebugEntry[] entries)
        {
            if (listener == null)
                throw new ArgumentNullException("listener");
            if (entries == null)
                throw new ArgumentNullException("entries");

            Listener = listener;
            Entries = entries;
        }
 /// <summary>
 /// Writes a debug entry into the log.
 /// </summary>
 public void WriteLine(DebugEntry entry)
 {
     if (MatchesCriteria(entry.Category))
     {
         foreach (var listener in _listeners)
         {
             listener.WriteLine(entry);
         }
     }
 }
        /// <summary>
        /// Writes a debug entry into the log.
        /// </summary>
        public void WriteLine(DebugEntry entry)
        {
            string message = entry.Message;

            if (entry.HasStackTrace)
                message = string.Concat(message, NewLine, entry.StackTrace);

            Debug.WriteLine(message);
#if !WINDOWS_STORE
            Console.WriteLine(message);
#endif
        }
Пример #5
0
        public static void WriteLine(string category, string message, Exception exception)
        {
            var entry = new DebugEntry(category, message, exception);

            lock (typeof(DebugLog))
            {
                foreach (var traceListender in Listeners)
                {
                    traceListender.WriteLine(entry);
                }
            }
        }
Пример #6
0
        /// <summary>
        /// Writes a debug entry into the log.
        /// </summary>
        public void WriteLine(DebugEntry entry)
        {
            string message = entry.Message;

            if (entry.HasStackTrace)
            {
                message = string.Concat(message, NewLine, entry.StackTrace);
            }

            Debug.WriteLine(message);
#if !WINDOWS_STORE
            Console.WriteLine(message);
#endif
        }
Пример #7
0
        /// <summary>
        /// Queues new item for later notification.
        /// </summary>
        public void Add(DebugEntry entry)
        {
            if (_timer == null)
            {
                if (_entriesAddedDelegate != null)
                {
                    NotifyEntriesAdded(new[] { entry });
                }
            }
            else
            {
                lock (_timer)
                {
                    _entries.Add(entry);
                }

                StartTimerIfRequired();
            }
        }
        private void UpdateTimeArray(DebugEntry entry)
        {
            DateTime time = entry.LogTime;

            _time[0] = time.Hour < 10 ? '0' : (char)('0' + (time.Hour / 10));
            _time[1] = (char)('0' + (time.Hour % 10));

            _time[3] = time.Minute < 10 ? '0' : (char)('0' + (time.Minute / 10));
            _time[4] = (char)('0' + (time.Minute % 10));

            _time[6] = time.Second < 10 ? '0' : (char)('0' + (time.Second / 10));
            _time[7] = (char)('0' + (time.Second % 10));

            int millisecond = time.Millisecond;

            _time[11]    = (char)('0' + (millisecond % 10));
            millisecond /= 10;
            _time[10]    = (char)('0' + (millisecond % 10));
            millisecond /= 10;
            _time[9]     = (char)('0' + (millisecond % 10));
        }
        /// <summary>
        /// Writes a debug entry into the log.
        /// </summary>
        public void WriteLine(DebugEntry entry)
        {
            if (string.IsNullOrEmpty(entry.Message))
            {
                return;
            }
            if (_output == null)
            {
                return;
            }

            if (_printTime)
            {
                UpdateTimeArray(entry);
                _output.Write(_time);
            }

            _output.WriteLine(entry.Message);

            if (!string.IsNullOrEmpty(entry.StackTrace))
            {
                _output.WriteLine(entry.StackTrace);
            }
        }
Пример #10
0
        public static void WriteLine(string category, string message, Exception exception)
        {
            var entry = new DebugEntry(category, message, exception);

            lock (typeof(DebugLog))
            {
                foreach (var traceListender in Listeners)
                    traceListender.WriteLine(entry);
            }
        }
Пример #11
0
 public void WriteLine(DebugEntry entry)
 {
     Count++;
 }
Пример #12
0
 private void NotifyEntriesAdded(DebugEntry[] entries)
 {
     Event.Invoke(_entriesAddedDelegate, _sourceListener, new DebugListenerEventArgs(_sourceListener, entries));
 }
        private void UpdateTimeArray(DebugEntry entry)
        {
            DateTime time = entry.LogTime;

            _time[0] = time.Hour < 10 ? '0' : (char) ('0' + (time.Hour / 10));
            _time[1] = (char) ('0' + (time.Hour % 10));

            _time[3] = time.Minute < 10 ? '0' : (char)('0' + (time.Minute / 10));
            _time[4] = (char)('0' + (time.Minute % 10));

            _time[6] = time.Second < 10 ? '0' : (char)('0' + (time.Second / 10));
            _time[7] = (char)('0' + (time.Second % 10));

            int millisecond = time.Millisecond;
            _time[11] = (char)('0' + (millisecond % 10));
            millisecond /= 10;
            _time[10] = (char)('0' + (millisecond % 10));
            millisecond /= 10;
            _time[9] = (char)('0' + (millisecond % 10));
        }
        /// <summary>
        /// Writes a debug entry into the log.
        /// </summary>
        public void WriteLine(DebugEntry entry)
        {
            if (string.IsNullOrEmpty(entry.Message))
                return;
            if (_output == null)
                return;

            if (_printTime)
            {
                UpdateTimeArray(entry);
                _output.Write(_time);
            }

            _output.WriteLine(entry.Message);

            if (!string.IsNullOrEmpty(entry.StackTrace))
            {
                _output.WriteLine(entry.StackTrace);
            }
        }
Пример #15
0
 /// <summary>
 /// Writes a debug entry into the log.
 /// </summary>
 public void WriteLine(DebugEntry entry)
 {
     if (MatchesFilter(entry.Category))
     {
         _entries.Add(entry);
         _delayingModule.Add(entry);
     }
 }
 /// <summary>
 /// Writes a debug entry into the log.
 /// </summary>
 public void WriteLine(DebugEntry entry)
 {
     if (MatchesCriteria(entry.Category))
     {
         foreach (var listener in _listeners)
         {
             listener.WriteLine(entry);
         }
     }
 }
Пример #17
0
        /// <summary>
        /// Queues new item for later notification.
        /// </summary>
        public void Add(DebugEntry entry)
        {
            if (_timer == null)
            {
                if (_entriesAddedDelegate != null)
                    NotifyEntriesAdded(new[] { entry });
            }
            else
            {
                lock (_timer)
                {
                    _entries.Add(entry);
                }

                StartTimerIfRequired();
            }
        }