Get started

WPClogger is currently in Alpha stages, to get started with it all you need to do is drop the WPClogger.cs file into your Windows Phone app project, change it's namespace to match your project's set the "configurable variables" with your own preferences (such as the support e-mail address you wish to use).

This documentation will improve with time!

For now each method is documented in the source code, but all you need to do is initialise the logger in your App.xaml.cs file with the log level you want to use:

public static WPClogger logger = new WPClogger(LogLevel.debug);

And add the following line into your application's unhandled exception method:

logger.log(LogLevel.critical, e.ExceptionObject);

You're now logging anything which crashes your application, and can use this code in your App's startup or main page to test for Critical exceptions and send them back to your support address:

if (App.logger.hasCriticalLogged())
{
       App.logger.emailReport();
       App.logger.clearEventsFromLog();
}

Last edited Apr 22, 2012 at 11:08 PM by JayTBennett, version 2

Comments

No comments yet.