From d4dfe92e05ccfbf67c8a5e9ad68651787b9d1f0d Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Fri, 22 Mar 2024 22:45:05 +0000 Subject: [PATCH] Sentry stuff (#99) * Small Sentry tweak --- src/main/kotlin/org/quiltmc/community/_Utils.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/org/quiltmc/community/_Utils.kt b/src/main/kotlin/org/quiltmc/community/_Utils.kt index c61b155..f2f9334 100644 --- a/src/main/kotlin/org/quiltmc/community/_Utils.kt +++ b/src/main/kotlin/org/quiltmc/community/_Utils.kt @@ -28,6 +28,7 @@ import dev.kord.core.entity.channel.GuildMessageChannel import dev.kord.rest.builder.message.EmbedBuilder import dev.kord.rest.request.RestRequestException import kotlinx.coroutines.runBlocking +import mu.KotlinLogging import org.koin.dsl.bind import org.quiltmc.community.database.Database import org.quiltmc.community.database.collections.* @@ -131,6 +132,8 @@ suspend fun ExtensibleBotBuilder.database(migrate: Boolean = false) { } suspend fun ExtensibleBotBuilder.common() { + val logger = KotlinLogging.logger { } + dataAdapter(::MongoDBDataAdapter) applicationCommands { @@ -140,13 +143,12 @@ suspend fun ExtensibleBotBuilder.common() { extensions { sentry { - val sentryDsn = envOrNull("SENTRY_DSN") val version: String? = object {}::class.java.`package`.implementationVersion - if (sentryDsn != null) { - enable = true + enableIfDSN(envOrNull("SENTRY_DSN")) - dsn = sentryDsn + if (enable) { + logger.info { "Sentry enabled." } } if (version != null) {