diff --git a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewAction.kt b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewAction.kt index bc8803251945..1524f6683f5d 100644 --- a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewAction.kt +++ b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewAction.kt @@ -50,6 +50,7 @@ internal class WhatsNewAction : AnAction(), com.intellij.openapi.project.DumbAwa val content: WhatsNewContent? = WhatsNewContent.getWhatsNewContent() suspend fun openWhatsNew(project: Project) { + LOG.info("Open What's New page requested.") val dataContext = LOG.runAndLogException { DataManager.getInstance().dataContextFromFocusAsync.await() } openWhatsNewPage(project, dataContext) } @@ -72,6 +73,7 @@ internal class WhatsNewAction : AnAction(), com.intellij.openapi.project.DumbAwa check(JBCefApp.isSupported()) { "JCEF is not supported on this system" } val title = IdeBundle.message("update.whats.new", ApplicationNamesInfo.getInstance().fullProductName) withContext(Dispatchers.EDT) { + LOG.info("Opening What's New in editor.") openEditor(project, title, whatsNewContent.getRequest(dataContext))?.let { project.serviceAsync().addTopComponent(it, ReactionsPanel.createPanel(PLACE, reactionChecker)) WhatsNewCounterUsageCollector.openedPerformed(project, byClient) diff --git a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewContentVersionChecker.kt b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewContentVersionChecker.kt index f3d96cd4115a..b8c3725b04b5 100644 --- a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewContentVersionChecker.kt +++ b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewContentVersionChecker.kt @@ -3,7 +3,6 @@ package com.intellij.platform.whatsNew import com.intellij.ide.util.PropertiesComponent import com.intellij.openapi.diagnostic.logger -import com.intellij.openapi.diagnostic.trace internal class WhatsNewContentVersionChecker { companion object { @@ -13,7 +12,7 @@ internal class WhatsNewContentVersionChecker { fun isNeedToShowContent(whatsNewContent: WhatsNewContent): Boolean { val savedVersionInfo = PropertiesComponent.getInstance().getValue(LAST_SHOWN_EAP_VERSION_PROP) ?: run { - LOG.trace("$LAST_SHOWN_EAP_VERSION_PROP is not defined. Will show What's New.") + LOG.info("$LAST_SHOWN_EAP_VERSION_PROP is not defined. Will show What's New.") return true } val savedVersion = WhatsNewContent.ContentVersion.parse(savedVersionInfo) ?: run { @@ -27,12 +26,12 @@ internal class WhatsNewContentVersionChecker { } val result = newVersion > savedVersion || (newVersion.releaseInfoEquals(savedVersion) && newVersion.hash != savedVersion.hash) - LOG.trace { "Comparing versions $newVersion > $savedVersion: $result." } + LOG.info("Comparing versions $newVersion > $savedVersion: $result.") return result } fun saveLastShownContent(content: WhatsNewContent) { - LOG.trace { "EapWhatsNew version saved '${content.getVersion()}'" } + LOG.info("EapWhatsNew version saved '${content.getVersion()}'") val version = content.getVersion() ?: run { LOG.error("What's New content $content returned a null version.") return diff --git a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewShowOnStartCheckService.kt b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewShowOnStartCheckService.kt index 374266943637..8cbf4b23761b 100644 --- a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewShowOnStartCheckService.kt +++ b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewShowOnStartCheckService.kt @@ -3,6 +3,7 @@ package com.intellij.platform.whatsNew import com.intellij.openapi.actionSystem.ActionManager import com.intellij.openapi.components.service +import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.project.Project import com.intellij.openapi.startup.ProjectActivity import com.intellij.openapi.util.registry.Registry @@ -17,10 +18,13 @@ internal class WhatsNewShowOnStartCheckService : ProjectActivity { override suspend fun execute(project: Project) { if (ourStarted.getAndSet(true)) return if (application.isHeadlessEnvironment || application.isUnitTestMode || isPlaybackMode) return + logger.info("Checking whether to show the What's New page on startup.") val content = WhatsNewContent.getWhatsNewContent() + logger.info("Got What's New content: $content") if (content != null) { - if (isWhatsNewTestMode || WhatsNewContentVersionChecker.isNeedToShowContent(content)) { + if (isWhatsNewTestMode.also { logger.info("What's New test mode: $it") } + || WhatsNewContentVersionChecker.isNeedToShowContent(content).also { logger.info("Should show What's New: $it") }) { val whatsNewAction = service().getAction("WhatsNewAction") as? WhatsNewAction whatsNewAction?.openWhatsNew(project) } @@ -30,3 +34,5 @@ internal class WhatsNewShowOnStartCheckService : ProjectActivity { internal val isWhatsNewTestMode: Boolean get() = Registry.`is`("whats.new.test.mode") + +private val logger = logger() \ No newline at end of file