Skip to content

Commit

Permalink
sentry install id (#143)
Browse files Browse the repository at this point in the history
* sentry install id

* trigger test
  • Loading branch information
dimacodota authored May 6, 2021
1 parent b2358d7 commit abc3db2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/com/tabnine/logging/LogInitializer.kt
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
package com.tabnine.logging

import com.intellij.openapi.application.ApplicationInfo
import com.intellij.openapi.application.PermanentInstallationID
import com.tabnine.config.Config
import com.tabnine.general.Utils
import io.sentry.Scope
import io.sentry.Sentry
import io.sentry.protocol.User
import org.apache.log4j.LogManager

fun init() {
Sentry.init()
if (!Sentry.isEnabled()) {
return
}
Sentry.configureScope { scope: Scope ->
scope.setTag("ide", ApplicationInfo.getInstance().versionName)
scope.setTag("ideVersion", ApplicationInfo.getInstance().fullVersion)
scope.setTag("pluginVersion", Utils.cmdSanitize(Utils.getTabNinePluginVersion()))
scope.setTag("os", System.getProperty("os.name"))
scope.setTag("channel", Config.CHANNEL)
}
val user = User().apply {
id = PermanentInstallationID.get()
}
Sentry.setUser(user)
val tabnineLogger = LogManager.getLogger("#com.tabnine")
val sentryAppender = SentryAppender()
tabnineLogger.addAppender(sentryAppender)
Expand Down

0 comments on commit abc3db2

Please sign in to comment.