How NOT to write a logger
I am going over some library code at the moment, and I am following my usual routine of starting at the basic infrastructure to find the fault lines. Take a look at this:
public void Log(string pSource, string pMessage, EventLogEntryType pEntryType) { try { if (!EventLog.SourceExists(pSource)) { EventLog.CreateEventSource(pSource, "Application"); } EventLog.WriteEntry(pSource, pMessage, pEntryType); } catch (Exception _ex) { Log("", _ex.ToString(), EventLogEntryType.Error); } }This is… impressive.

Comments
Comment preview