Exemple #1
0
 public FileLogger(string file, LogEntry.LogTypes logFilter = LogEntry.LogTypes.All)
 {
     FileInfo f = new FileInfo(file);
     if (f.Exists)
         if (f.IsReadOnly) throw new FieldAccessException(file);
     _outFile = new FileInfo(file).FullName;
     LogFilter = logFilter;
 }
Exemple #2
0
 public LogEntry(LogEntry.LogTypes logType, DateTime timeStamp, string message, StackTrace stacktrace, object[] oparams, Exception exception, Thread thread)
 {
     _logType    = logType;
     _timeStamp  = timeStamp;
     _message    = message;
     _stacktrace = stacktrace;
     _params     = oparams;
     _exception  = exception;
     _thread     = thread;
 }
Exemple #3
0
 private static void DoLog(LogEntry.LogTypes logType, DateTime timeStamp, string message, StackTrace stacktrace, object[] oparams, Exception exception)
 {
     DoLog(new LogEntry(
               logType,
               timeStamp,
               message,
               stacktrace,
               oparams,
               exception,
               System.Threading.Thread.CurrentThread
               ));
 }
Exemple #4
0
 public void RefreshWithFilter(LogEntry.LogTypes filter)
 {
     _logFilter = filter;
     if (OnEntryAdded != null)
     {
         foreach (LogEntry entry in _entrys)
         {
             if (_isInFilter(entry.LogType))
             {
                 OnEntryAdded(entry);
             }
         }
     }
 }
        public FileLogger(string file, LogEntry.LogTypes logFilter = LogEntry.LogTypes.All)
        {
            FileInfo f = new FileInfo(file);

            if (f.Exists)
            {
                if (f.IsReadOnly)
                {
                    throw new FieldAccessException(file);
                }
            }
            _outFile  = new FileInfo(file).FullName;
            LogFilter = logFilter;
        }
 public ConsoleLogger(LogEntry.LogTypes logtypes = LogEntry.LogTypes.NoDebug)
 {
     this._logTypes = logtypes;
 }
Exemple #7
0
 private bool _isInFilter(LogEntry.LogTypes type)
 {
     return((type & this._logFilter) != 0);
 }
 public ConsoleLogger(LogEntry.LogTypes logtypes = LogEntry.LogTypes.NoDebug)
 {
     this._logTypes = logtypes;
 }
Exemple #9
0
 public void RefreshWithFilter(LogEntry.LogTypes filter)
 {
     _logFilter = filter;
     if (OnEntryAdded != null)
         foreach (LogEntry entry in _entrys)
             if (_isInFilter(entry.LogType))
                 OnEntryAdded(entry);
 }