Exemple #1
0
 public LogEvent(string source, LogEventType type, string message, DateTime timestamp, Exception exception)
 {
     Source = source;
     Type = type;
     Message = message;
     Timestamp = timestamp;
     Exception = exception;
 }
Exemple #2
0
        private void LogCore(LogEventType type, Exception exc, string @event)
        {
            Assert.IsNotNull(type);

            var evt = new LogEvent(_source, type, @event, DateTime.Now, exc);
            lock(_log)
            {
                int index;
                if(_count == _log.Length)
                {
                    index = _start;
                    _start = (_start + 1) % _log.Length;
                }
                else
                {
                    index = (_start + _count) % _log.Length;
                    ++_count;
                }
                _log[index] = evt;
                for(int i = 0; i < _appenders.Count; ++i)
                {
                    _appenders[i].Append(evt);
                }
            }
        }
Exemple #3
0
        public void Log(LogEventType type, Exception exc, string @event, params object[] args)
        {
            Verify.Argument.IsNotNull(type, "type");

            LogCore(type, exc, string.Format(@event, args));
        }
Exemple #4
0
        public void Log(LogEventType type, Exception exc, string @event)
        {
            Verify.Argument.IsNotNull(type, "type");

            LogCore(type, exc, @event);
        }
Exemple #5
0
        public void Log(LogEventType type, string @event, object arg0)
        {
            Verify.Argument.IsNotNull(type, "type");

            LogCore(type, null, string.Format(@event, arg0));
        }
Exemple #6
0
        public void Log(LogEventType type, string @event)
        {
            Verify.Argument.IsNotNull(type, "type");

            LogCore(type, null, @event);
        }