From 19f32e4346a333bf009af86bb84feeffc504a84c Mon Sep 17 00:00:00 2001 From: brianneoberson Date: Tue, 12 Dec 2023 12:26:48 +0100 Subject: [PATCH] Replace println with logger.info Signed-off-by: brianneoberson --- .../pitmutationmate/actions/ContextMenuAction.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pitmutationmate/src/main/kotlin/com/amos/pitmutationmate/pitmutationmate/actions/ContextMenuAction.kt b/pitmutationmate/src/main/kotlin/com/amos/pitmutationmate/pitmutationmate/actions/ContextMenuAction.kt index 020a0a5b..097139b3 100644 --- a/pitmutationmate/src/main/kotlin/com/amos/pitmutationmate/pitmutationmate/actions/ContextMenuAction.kt +++ b/pitmutationmate/src/main/kotlin/com/amos/pitmutationmate/pitmutationmate/actions/ContextMenuAction.kt @@ -6,17 +6,19 @@ package com.amos.pitmutationmate.pitmutationmate.actions import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys +import com.intellij.openapi.diagnostic.Logger import com.intellij.psi.PsiClass import com.intellij.psi.PsiClassOwner import com.intellij.psi.PsiElement import org.jetbrains.kotlin.psi.KtClass class ContextMenuAction : RunConfigurationAction() { + private val logger = Logger.getInstance(ContextMenuAction::class.java) override fun actionPerformed(e: AnActionEvent) { val editor = e.getData(CommonDataKeys.EDITOR) val psiFile = e.getData(CommonDataKeys.PSI_FILE) if (e.place == "EditorPopup") { - println("ContextMenuAction: actionPerformed in EditorPopup for file $psiFile") + logger.info("ContextMenuAction: actionPerformed in EditorPopup for file $psiFile") val psiElement = psiFile?.findElementAt(editor?.caretModel!!.offset) val selectedClass = findEnclosingClass(psiElement) if (selectedClass != null) { @@ -28,17 +30,16 @@ class ContextMenuAction : RunConfigurationAction() { classFQN = selectedClass.fqName.toString() } - println("ContextMenuAction: selected class is $classFQN.") + logger.info("ContextMenuAction: selected class is $classFQN.") updateAndExecuteRunConfig(classFQN, e.project!!, editor) } } if (e.place == "ProjectViewPopup") { - println("ContextMenuAction: actionPerformed in ProjectViewPopup for file $psiFile") + logger.info("ContextMenuAction: actionPerformed in ProjectViewPopup for file $psiFile") val psiClasses = (psiFile as PsiClassOwner).classes var classFQNs: String = "" for (psiClass in psiClasses) { val fqn = psiClass.qualifiedName - println("$fqn") if (fqn != null) { classFQNs = if (classFQNs != "") { "$classFQNs,$fqn" @@ -47,7 +48,7 @@ class ContextMenuAction : RunConfigurationAction() { } } } - println("ContextMenuAction: selected classes are $classFQNs.") + logger.info("ContextMenuAction: selected classes are $classFQNs.") updateAndExecuteRunConfig(classFQNs, e.project!!, editor) } }