Skip to content

Instantly share code, notes, and snippets.

View PanosJee's full-sized avatar

Panos Papadopoulos PanosJee

View GitHub Profile
@PanosJee
PanosJee / gist:4599056
Created January 22, 2013 22:13
Windows 8 Store app bugsense initialization
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
// Initialize BugSense
BugSenseHandler.Instance.Init(this, "YOUR_API_KEY");
}
@PanosJee
PanosJee / gist:4330524
Created December 18, 2012 18:18
Set a localized fix notification
/* Localized fix notifications */
BugSenseHandler.SetLocalizedFixNotifications(
"Un correctif est disponible", // Title
"S\'il vous plaît mettre à jour à la version dernière" // Content
);
@PanosJee
PanosJee / gist:4330511
Created December 18, 2012 18:16
Event tracking for Windows 8, Windows Phone 8
/* Send event */
BugSenseHandler.Instance.SendEvent("anEvent");
@PanosJee
PanosJee / gist:4330494
Created December 18, 2012 18:14
User Bugsense along with the VisualStudio debugger
/*
* Alternatively you can initialize the plugin to work
* along with the Visual Studio debugger
*/
public App()
{
// Global handler for uncaught exceptions.
BugSenseHandler.Instance.Init(this, "YOUR_API_KEY", new NotificationOptions() { HandleWhileDebugging = true });
}
@PanosJee
PanosJee / gist:4330479
Created December 18, 2012 18:12
Execute a method before app crash
/* Set Last Action */
public App()
{
// Global handler for uncaught exceptions.
BugSenseHandler.Instance.Init(this, "YOUR_API_KEY");
BugSenseHandler.SetLastBreath(MyMethod);
// ...do more stuff...
}
@PanosJee
PanosJee / default.js
Created November 27, 2012 15:46
WinJS bugsense initialization
// Create the app
var app = WinJS.Application;
// Initialize bugsense
var bugsense = new Bugsense( {
apiKey: 'YOUR_API_KEY',
context: app
} );
// If you want to display a popup (against MS guidelines) add the message option
@PanosJee
PanosJee / gist:4135955
Created November 23, 2012 14:46
Bugsense.js breadcrumbs & metadata
// add metadata
bugsense.addExtraData( 'user_level', 'paid' );
bugsense.addExtraData( 'account', 'CEO' );
// Clear all metadata
bugsense.clearExtraData();
// leave breadcrumb
bugsense.leaveBreadcrumb( 'Fetch Friendlist' );
@PanosJee
PanosJee / gist:4135906
Created November 23, 2012 14:41
Handled JS exception
try {
rotateScreen();
} catch ( error ) {
bugsense.notify( error, { rotation: 'not supported' } )
};
@PanosJee
PanosJee / gist:4135881
Created November 23, 2012 14:33
BugSense JS init
<script src="http://www.bugsense.com/static/js/global/bugsense.js" type='text/javascript'></script>
<script type="text/javascript">
var bugsense = new Bugsense( { apiKey: 'YOUR_API_KEY' } );
</script>
@PanosJee
PanosJee / gist:3980821
Created October 30, 2012 15:12
Logged Exceptions for WP8/W8
// Without extra data
try
{
throw new Exception("error");
}
catch (Exception exc)
{
BugSenseHandler.Instance.LogException(exc);
}