Skip to content

Commit 662e6a9

Browse files
committed
impl(common): add sentry toggle in vals.properties
* allows to easily toggle sentry * TODO: edit this via command
1 parent 61fb7ba commit 662e6a9

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

common/src/main/kotlin/com/wolfyscript/customcrafting/sentry/SentryUtils.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ fun initSentry() {
3535
}
3636

3737
Sentry.init {
38-
it.dsn = "https://[email protected]/1"
38+
it.isEnabled = CustomCraftingProperties.sentryEnabled
39+
it.dsn = CustomCraftingProperties.sentryDsn
3940
it.release = CustomCraftingProperties.release
4041
it.isSendDefaultPii = false // don't send personal identifiable information (ip, computer name, etc.)
4142
it.tracesSampleRate = null // make sure tracing is always disabled. we don't care about performance monitoring.
4243
it.addInAppInclude("com.wolfyscript")
4344
it.isEnableUncaughtExceptionHandler = true
44-
it.isDebug = true
45+
it.isDebug = false
4546
it.setLogger(SystemOutLogger())
4647

4748
it.beforeSend = SentryOptions.BeforeSendCallback({ event, hint ->

common/src/main/kotlin/com/wolfyscript/customcrafting/util/CustomCraftingProperties.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ object CustomCraftingProperties {
1212

1313
val release: String = properties.getProperty("release") ?: "unknown"
1414

15+
val sentryDsn: String = properties.getProperty("sentry.dsn") ?: ""
16+
17+
val sentryEnabled: Boolean = properties.getProperty("sentry.enabled").toBoolean()
18+
1519
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
release=${customcrafting_release}
1+
release=${customcrafting_release}
2+
sentry.dsn=https://[email protected]/1
3+
sentry.enabled=true

0 commit comments

Comments
 (0)