[TASK] Added filters for bugsnag

This commit is contained in:
JKetelaar
2016-01-03 15:02:02 +01:00
parent 275b4d633c
commit da365a82a6
4 changed files with 21 additions and 3 deletions
+14 -2
View File
@@ -1,6 +1,8 @@
package org.parabot.core;
import com.bugsnag.BeforeNotify;
import com.bugsnag.Client;
import com.bugsnag.Error;
import org.json.simple.JSONObject;
import org.json.simple.parser.ParseException;
import org.parabot.Landing;
@@ -301,11 +303,21 @@ public class Core {
}
public static void setBugsnagVersion(){
Core.bugsnagInstance.setReleaseStage(currentVersion.compareTo(latestVersion) >= 0 ? "development" : "production");
Core.bugsnagInstance.setReleaseStage(currentVersion != latestVersion ? "development" : "production");
}
public static void setBugsnagUser(String id, String email, String username){
Core.bugsnagInstance.setUser(id, email, username);
// TODO Check order of parameters
Core.bugsnagInstance.setUser(username, email, id);
}
public static void setBugsnagServer(String server){
Core.setBugsnagInformation("Server", "Server", server);
}
public static void setBugsnagInformation(String tab, String key, String value){
// TODO Should be checked if correct
Core.bugsnagInstance.addToTab(tab, key, value);
}
public static void debug(int i) {
@@ -11,9 +11,10 @@ import java.io.*;
import java.util.*;
/**
* Holds parabot's used directories
* Holds and manages Parabot's used directories
*
* @author Everel
* @author JKetelaar
* @author Matt
*/
public class Directories {
@@ -156,6 +156,7 @@ public class Script implements Runnable {
if(state < 0 || state > 2) {
throw new IllegalArgumentException("Illegal state");
}
Core.setBugsnagInformation("Script", "State", String.valueOf(state));
this.state = state;
}
@@ -180,5 +181,6 @@ public class Script implements Runnable {
public void setScriptID(int scriptID){
this.scriptID = scriptID;
Core.setBugsnagInformation("Script", "State", String.valueOf(scriptID));
}
}
@@ -1,6 +1,7 @@
package org.parabot.environment.servers.executers;
import org.parabot.core.Context;
import org.parabot.core.Core;
import org.parabot.core.parsers.randoms.RandomParser;
import org.parabot.core.ui.components.PaintComponent;
import org.parabot.environment.servers.ServerProvider;
@@ -23,6 +24,8 @@ public abstract class ServerExecuter {
@Override
public void run() {
try {
Core.setBugsnagServer(serverName);
Context context = Context.getInstance(provider);
context.load();
PaintComponent.getInstance().startPainting(context);