Skip to content

Commit

Permalink
inspector: Add possibility to build plugin without DSN
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed Feb 16, 2021
1 parent a4781f0 commit fc89fb0
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import org.jetbrains.annotations.NotNull;
import ru.endlesscode.inspector.bukkit.plugin.TrackedPlugin;
import ru.endlesscode.inspector.bukkit.report.BukkitEnvironment;
import ru.endlesscode.inspector.report.Reporter;
import ru.endlesscode.inspector.report.SentryReporter;
import ru.endlesscode.inspector.report.*;
import ru.endlesscode.inspector.sentry.bukkit.SentryBukkitIntegration;
import ru.endlesscode.rpginventory.utils.Log;

import java.util.Arrays;
import java.util.List;
Expand All @@ -43,8 +43,14 @@ public RPGInventoryPlugin() {

@Override
protected final @NotNull Reporter createReporter() {
String dsn = "@sentry_dsn@"; // Token will be replaced in compile time, so it can be empty
if (dsn.isEmpty()) {
Log.w("It is unofficial build of RPGInventory.");
dsn = "no_dsn";
}

return new SentryReporter.Builder()
.setDsn("@sentry_dsn@")
.setDsn(dsn)
.addIntegration(new SentryBukkitIntegration(this))
.focusOn(this)
.build();
Expand Down

0 comments on commit fc89fb0

Please sign in to comment.