The other day, a co-worker created a simple interface to report errors/messages
public interface IErrorReporter
{
void ReportError(string title, string message, string detail);
}
The goal is to keep lower-level "business logic" code free of UI such as MessageBox.Show()
.
My reaction is there has to be something already "out there" to help with this, but I can't really find anything. Note that I'm not looking for a fancy error reporting, exception-handling mechanism; just something "out of the box" to avoid/reduce creating/implementing my own interface.
A custom trace listener looks like one alternative, but System.Diagnostics.Trace
just doesn't feel like the right alternative to MessageBox.Show()
. Using a third-party solution such as log4net seems like overkill for four lines.