public FileLoggerProvider(string filename, EventFilterDelegate filter = null) { var stream = new FileStream(filename, FileMode.Append, FileAccess.Write, FileShare.ReadWrite); _writer = new StreamWriter(stream, Encoding.UTF8, 1024 * 10, leaveOpen: false) { AutoFlush = true }; _filter = filter; }
/// <summary> /// Initializes a new instance of the <see cref="EventFilter" /> class /// with the given process function. /// </summary> /// <param name="processAction"> /// The function to call when the <see cref="Process" /> function is /// called. /// </param> public EventFilter(EventFilterDelegate <EventArgs> processAction, EventFilterType eventType = EventFilterType.All) { _processAction = processAction; EventType = eventType; }