OfficeDev/PnP — pull request #38 by sgryphon (2014-08-19 11:29:53+00:00)
Title: Logging improvements

Error logging was pretty rough, e.g. hard coded to write to the console (even if, for example, running in a web application).

I have changed it to use the standard .NET Framework System.Diagnostics with a named TraceSource "OfficeDevPnP.Core".

Tracing should generally be an internal system, however it was public so I have kept the old behaviour (marked Obsolete), including automatically configuring writing to the console if needed. This means that all existing samples should continue to operate the same (with slightly different output format). (It also probably shouldn't be a partial class, but I have left that for now as well).

Using TraceSource means the level of diagnostics can be configured and directed to the console, ASP.NET trace, or other listeners (including third part like log4net or NLog). These changes will give a good base for moving forward, adding things like activity scopes and correlation IDs.