Skip to content

Commit

Permalink
set server id on sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
inductor committed May 7, 2023
1 parent 3a209fa commit 56fac90
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/main/scala/com/github/unchama/seichiassist/SeichiAssist.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ 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}
Expand Down Expand Up @@ -137,15 +138,6 @@ class SeichiAssist extends JavaPlugin() {
implicit val loggerF: io.chrisdavenport.log4cats.Logger[IO] =
Slf4jLogger.getLoggerFromSlf4j(logger)

Sentry.init(options => {
options.setDsn("https://[email protected]/2");
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
options.setTracesSampleRate(1.0);
// When first trying Sentry it's good to see what the SDK is doing:
options.setDebug(true);
});

// endregion

private var repeatedTaskFiber: Option[Fiber[IO, List[Nothing]]] = None
Expand Down Expand Up @@ -604,6 +596,18 @@ class SeichiAssist extends JavaPlugin() {
// コンフィグ系の設定は全てConfig.javaに移動
SeichiAssist.seichiAssistConfig = Config.loadFrom(this)

Sentry.init(options => {
options.setDsn("https://[email protected]/2");
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
options.setTracesSampleRate(1.0);
// 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をデバッグモードで起動します")
Expand Down

0 comments on commit 56fac90

Please sign in to comment.