diff --git a/build.gradle b/build.gradle index c8740c404..814b23730 100644 --- a/build.gradle +++ b/build.gradle @@ -140,6 +140,8 @@ dependencies { implementation 'org.apache.commons:commons-text:1.10.0' implementation 'io.sentry:sentry:6.24.0' + implementation 'com.jsoftbiz:os-platform-finder:1.1' + // when updating the versions here, also update them in AsciiDocDownloaderUtil for dynamic download testImplementation 'org.asciidoctor:asciidoctorj-diagram:2.2.9' testImplementation 'org.asciidoctor:asciidoctorj-pdf:2.3.7' diff --git a/src/main/java/org/asciidoc/intellij/errorHandler/SentryErrorReporter.java b/src/main/java/org/asciidoc/intellij/errorHandler/SentryErrorReporter.java index 64fdd451c..6755396e5 100644 --- a/src/main/java/org/asciidoc/intellij/errorHandler/SentryErrorReporter.java +++ b/src/main/java/org/asciidoc/intellij/errorHandler/SentryErrorReporter.java @@ -11,10 +11,13 @@ import com.intellij.openapi.diagnostic.Attachment; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.diagnostic.SubmittedReportInfo; +import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.extensions.PluginId; import com.intellij.openapi.util.SystemInfo; +import com.intellij.openapi.util.SystemInfoRt; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.Consumer; +import com.jsoftbiz.utils.OS; import io.sentry.DuplicateEventDetectionEventProcessor; import io.sentry.ILogger; import io.sentry.Sentry; @@ -30,6 +33,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import javax.swing.UIManager; import java.nio.charset.StandardCharsets; import java.util.Formatter; import java.util.HashMap; @@ -113,6 +117,11 @@ public boolean isEnabled(@Nullable SentryLevel level) { event.setTag("java_vendor", SystemInfo.JAVA_VENDOR); event.setTag("java_version", SystemInfo.JAVA_VERSION); + event.setTag("ui.theme", getUiTheme()); + event.setTag("ui.dark", getUiMode()); + if (SystemInfoRt.isLinux) { + event.setTag("linux_platform", getLinuxPlatformName()); + } // clear the server name, as it is of no use to analyze the error event.setServerName(null); @@ -234,4 +243,16 @@ private static void fillActivePlugins(Contexts contexts) { contexts.put("active plugins", activePlugins); } } + + private static String getUiTheme() { + return UIManager.getLookAndFeel().getName(); + } + + private static String getUiMode() { + return String.valueOf(EditorColorsManager.getInstance().isDarkEditor()); + } + + private static String getLinuxPlatformName() { + return OS.OS.getPlatformName(); + } }