client: Sentry logging (#1928)

client: Sentry logging
This commit is contained in:
Owain van Brakel
2019-11-08 00:47:42 +01:00
committed by GitHub
5 changed files with 13 additions and 18 deletions

View File

@@ -99,6 +99,7 @@ object Libraries {
const val rxrelay = "2.1.1"
const val scribejava = "6.9.0"
const val sisu = "0.3.3"
const val sentry = "1.7.28"
const val slf4j = "1.7.28"
const val springJdbc = "5.2.0.RELEASE"
const val springboot = "2.2.0.RELEASE"
@@ -179,6 +180,7 @@ object Libraries {
const val slf4jApi = "org.slf4j:slf4j-api:${Versions.slf4j}"
const val slf4jNop = "org.slf4j:slf4j-nop:${Versions.slf4j}"
const val slf4jSimple = "org.slf4j:slf4j-simple:${Versions.slf4j}"
const val sentry = "io.sentry:sentry:${Versions.sentry}"
const val springbootDevtools = "org.springframework.boot:spring-boot-devtools:${Versions.springboot}"
const val springbootStarter = "org.springframework.boot:spring-boot-starter:${Versions.springboot}"
const val springbootStarterWeb = "org.springframework.boot:spring-boot-starter-web:${Versions.springboot}"

View File

@@ -71,6 +71,7 @@ dependencies {
implementation(Libraries.jooq)
implementation(Libraries.jooqCodegen)
implementation(Libraries.jooqMeta)
implementation(Libraries.sentry)
implementation(Libraries.slf4jApi)
implementation(project(":http-api"))
implementation(project(":runelite-api"))

View File

@@ -32,6 +32,8 @@ import com.google.inject.Inject;
import com.google.inject.Injector;
import io.reactivex.Completable;
import io.reactivex.schedulers.Schedulers;
import io.sentry.Sentry;
import io.sentry.SentryClient;
import java.io.File;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
@@ -244,6 +246,10 @@ public class RuneLite
}
}
SentryClient client = Sentry.init("https://fa31d674e44247fa93966c69a903770f@sentry.io/1811856");
client.setRelease(RuneLiteProperties.getPlusVersion());
final ClientLoader clientLoader = new ClientLoader(options.valueOf(updateMode));
Completable.fromAction(clientLoader::get)
.subscribeOn(Schedulers.single())

View File

@@ -6,6 +6,7 @@ import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.sentry.Sentry;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -54,15 +55,7 @@ public class EventBus implements EventBusInterface
.cast(eventClass) // Cast it for easier usage
.subscribe(action, error ->
{
if (error instanceof RuntimeException)
{
log.error("Runtime Exception in eventbus", error);
System.exit(0);
}
else
{
log.error("Exception in eventbus", error);
}
Sentry.capture(error);
});
getCompositeDisposable(lifecycle).add(disposable);
@@ -84,15 +77,7 @@ public class EventBus implements EventBusInterface
.doFinally(() -> unregister(lifecycle))
.subscribe(action, error ->
{
if (error instanceof RuntimeException)
{
log.error("Runtime Exception in eventbus", error);
System.exit(0);
}
else
{
log.error("Exception in eventbus", error);
}
Sentry.capture(error);
});
getCompositeDisposable(lifecycle).add(disposable);

View File

@@ -0,0 +1 @@
stacktrace.app.packages=net.runelite.client