|
11 | 11 | import com.intellij.openapi.diagnostic.Attachment; |
12 | 12 | import com.intellij.openapi.diagnostic.Logger; |
13 | 13 | import com.intellij.openapi.diagnostic.SubmittedReportInfo; |
| 14 | +import com.intellij.openapi.editor.colors.EditorColorsManager; |
14 | 15 | import com.intellij.openapi.extensions.PluginId; |
15 | 16 | import com.intellij.openapi.util.SystemInfo; |
| 17 | +import com.intellij.openapi.util.SystemInfoRt; |
16 | 18 | import com.intellij.openapi.util.text.StringUtil; |
17 | 19 | import com.intellij.util.Consumer; |
| 20 | +import com.jsoftbiz.utils.OS; |
18 | 21 | import io.sentry.DuplicateEventDetectionEventProcessor; |
19 | 22 | import io.sentry.ILogger; |
20 | 23 | import io.sentry.Sentry; |
|
30 | 33 | import org.jetbrains.annotations.NotNull; |
31 | 34 | import org.jetbrains.annotations.Nullable; |
32 | 35 |
|
| 36 | +import javax.swing.UIManager; |
33 | 37 | import java.nio.charset.StandardCharsets; |
34 | 38 | import java.util.Formatter; |
35 | 39 | import java.util.HashMap; |
@@ -113,6 +117,11 @@ public boolean isEnabled(@Nullable SentryLevel level) { |
113 | 117 |
|
114 | 118 | event.setTag("java_vendor", SystemInfo.JAVA_VENDOR); |
115 | 119 | event.setTag("java_version", SystemInfo.JAVA_VERSION); |
| 120 | + event.setTag("ui.theme", getUiTheme()); |
| 121 | + event.setTag("ui.dark", getUiMode()); |
| 122 | + if (SystemInfoRt.isLinux) { |
| 123 | + event.setTag("linux_platform", getLinuxPlatformName()); |
| 124 | + } |
116 | 125 |
|
117 | 126 | // clear the server name, as it is of no use to analyze the error |
118 | 127 | event.setServerName(null); |
@@ -234,4 +243,16 @@ private static void fillActivePlugins(Contexts contexts) { |
234 | 243 | contexts.put("active plugins", activePlugins); |
235 | 244 | } |
236 | 245 | } |
| 246 | + |
| 247 | + private static String getUiTheme() { |
| 248 | + return UIManager.getLookAndFeel().getName(); |
| 249 | + } |
| 250 | + |
| 251 | + private static String getUiMode() { |
| 252 | + return String.valueOf(EditorColorsManager.getInstance().isDarkEditor()); |
| 253 | + } |
| 254 | + |
| 255 | + private static String getLinuxPlatformName() { |
| 256 | + return OS.OS.getPlatformName(); |
| 257 | + } |
237 | 258 | } |
0 commit comments