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 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; }
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 )); }
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; }
private bool _isInFilter(LogEntry.LogTypes type) { return((type & this._logFilter) != 0); }
public void RefreshWithFilter(LogEntry.LogTypes filter) { _logFilter = filter; if (OnEntryAdded != null) foreach (LogEntry entry in _entrys) if (_isInFilter(entry.LogType)) OnEntryAdded(entry); }