-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1968 from GiganticMinecraft/add_sentry
Add Sentry
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,8 @@ import com.github.unchama.seichiassist.task.PlayerDataSaveTask | |
import com.github.unchama.seichiassist.task.global._ | ||
import com.github.unchama.util.{ActionStatus, ClassUtils} | ||
import io.chrisdavenport.log4cats.slf4j.Slf4jLogger | ||
import io.sentry.Sentry | ||
import io.sentry.SentryLevel; | ||
import org.bukkit.Bukkit | ||
import org.bukkit.ChatColor._ | ||
import org.bukkit.entity.{Entity, Player, Projectile} | ||
|
@@ -594,6 +596,20 @@ class SeichiAssist extends JavaPlugin() { | |
// コンフィグ系の設定は全てConfig.javaに移動 | ||
SeichiAssist.seichiAssistConfig = Config.loadFrom(this) | ||
|
||
Sentry.init(options => { | ||
options.setDsn("https://[email protected]/2"); | ||
// パフォーマンスモニタリングに使うトレースサンプルの送信割合 | ||
// tracesSampleRateを1.0にすると全てのイベントが送られるため、送りすぎないように調整する必要がある | ||
options.setTracesSampleRate(0.25); | ||
// When first trying Sentry it's good to see what the SDK is doing: | ||
options.setDebug(true); | ||
|
||
// どのサーバーからイベントが送られているのかを判別する識別子 | ||
options.setEnvironment(SeichiAssist.seichiAssistConfig.getServerId); | ||
}); | ||
|
||
Sentry.configureScope(scope => scope.setLevel(SentryLevel.WARNING)); | ||
|
||
if (SeichiAssist.seichiAssistConfig.getDebugMode == 1) { | ||
// debugmode=1の時は最初からデバッグモードで鯖を起動 | ||
logger.info(s"${RED}SeichiAssistをデバッグモードで起動します") | ||
|