Skip to content

Instantly share code, notes, and snippets.

View PanosJee's full-sized avatar

Panos Papadopoulos PanosJee

View GitHub Profile
// Check is a task if task is faulted and log task exception if it failed
Task t = new Task(() =>
{
int x = 5;
int y = 0;
int z = x / y;
});
t.Start();
@PanosJee
PanosJee / gist:3980775
Created October 30, 2012 15:07
Add extra data & leave breadcrumb
// Adding custom extra to be sent with the crash
BugSenseHandler.AddToExtraData("xtra1key", "xtra1val");
BugSenseHandler.AddToExtraData("xtra2key", "xtra2val");
// Leave a breadcrump
BugSenseHandler.LeaveBreadcrumb("Fetch friends");
@PanosJee
PanosJee / App.xaml.cs
Created October 30, 2012 15:04
Initialize Bugsense
public App()
{
// Standard XAML initialization
InitializeComponent();
// Phone-specific initialization
InitializePhoneApplication();
// Language display initialization
InitializeLanguage();
@PanosJee
PanosJee / gist:3552211
Created August 31, 2012 12:34
BugSense2 Android setup
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
BugSenseHandler.initAndStartSession(Context, APIKEY);
setContentView(R.layout.main);
//rest of your code here
}
@PanosJee
PanosJee / gist:3551914
Created August 31, 2012 12:03
Adding metadata to Bugsense Android handled crash reports
HashMap<String, String> map = new HashMap<String, String>();
map.put("level", "second level");
map.put("difficulty", "impossibruuu");
BugSenseHandler.sendExceptionMap(map, ex);
@PanosJee
PanosJee / gist:3551885
Created August 31, 2012 11:58
Tracking handled exceptions with Bugsense Android
try{
String a = null;
a.toString();
}catch(Exception ex) {
ex.printStackTrace(); // in case you want to see the stacktrace in your log cat output
BugSenseHandler.sendException(ex);
}
@PanosJee
PanosJee / gist:3551833
Created August 31, 2012 11:50
Adding metadata to Bugsense Android crash reporter
HashMap<String, String> extras = new HashMap<String, String>();
extras.put("level", "second level");
extras.put("difficulty", "impossibruuu");
BugSenseHandler.addCrashExtraMap(extras);
@PanosJee
PanosJee / gist:3551749
Created August 31, 2012 11:38
bugsense enteriprice android setup
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
BugSenseHandler.initAndStartSession(Context, APIKEY, HOSTURL);
setContentView(R.layout.main);
//rest of your code here
}
@PanosJee
PanosJee / gist:2912787
Created June 11, 2012 21:20
bugsense logcat support
// For example if you want to get the last 1000 lines and log all messages
// with priority level "warning" and higher
BugSenseHandler.setLogging(1000, "*:W");
//Log last 100 messages
BugSenseHandler.readLogs(100);
//Log all the messages with priority level "warning" and higher, on all tags.
BugSenseHandler.readLogs("*:W");
{
"application_environment":{
"appname":"crash-me3",
"appver":"1.0",
"build_uuid":"7D65A0DB-C9E1-499F-9D20-BFE10E117181",
"carrier":"vf GR",
"gps_on":true,
"image_base_address":"0x2e000",
"image_size":"0x26000",
"internal_version":"1.0",