Exemplo n.º 1
0
 private void OnMessageCaptured(object sender, LogEventArgs e)
 {
     if(e.Severity >= HighPassFilter && MessageCaptured != null)
     {
         MessageCaptured?.Invoke(this, e);
     }
 }
Exemplo n.º 2
0
        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();
            }
        }