private void OnMessageCaptured(object sender, LogEventArgs e) { if(e.Severity >= HighPassFilter && MessageCaptured != null) { MessageCaptured?.Invoke(this, e); } }
private static void OnLogCaptured(object sender, LogEventArgs e) { if (e.Severity < HighPassFilter) return; if (!Directory.Exists(_appDataRoot)) { Directory.CreateDirectory(_appDataRoot); } string filepath = _appDataRoot + @"\" + _logFileName; using (StreamWriter outfile = new StreamWriter(filepath, true)) { outfile.WriteLine(e.Message); outfile.Close(); } }