From 203b4d4a70ab203ad5728815eb7ec5823948e4dd Mon Sep 17 00:00:00 2001 From: "ekaterina.itsenko" Date: Sat, 1 Mar 2025 01:47:55 +0100 Subject: [PATCH] [pycharm] PY-79243 Debugger: fix the review GitOrigin-RevId: 7c4082ba2322e3096d7d6e0557ad78da293bbee3 --- .../images/scientific/action/SaveImageAction.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/images/src/org/intellij/images/scientific/action/SaveImageAction.kt b/images/src/org/intellij/images/scientific/action/SaveImageAction.kt index 0deea49f56dc..fcd6518a2745 100644 --- a/images/src/org/intellij/images/scientific/action/SaveImageAction.kt +++ b/images/src/org/intellij/images/scientific/action/SaveImageAction.kt @@ -4,7 +4,7 @@ package org.intellij.images.scientific.action import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys -import com.intellij.openapi.diagnostic.thisLogger +import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.fileChooser.FileChooserFactory import com.intellij.openapi.fileChooser.FileSaverDescriptor import com.intellij.openapi.project.DumbAwareAction @@ -14,12 +14,13 @@ import org.intellij.images.scientific.ScientificUtils import java.io.IOException import java.nio.file.Files -class SaveImageAction : DumbAwareAction() { +internal class SaveImageAction : DumbAwareAction() { + override fun actionPerformed(e: AnActionEvent) { val project = e.project val virtualFile = e.getData(CommonDataKeys.VIRTUAL_FILE) if (virtualFile == null || project == null) { - LOG.error("Missing project or image file.") + logger.error("Missing project or image file.") return } @@ -33,7 +34,7 @@ class SaveImageAction : DumbAwareAction() { Files.write(wrapper.file.toPath(), virtualFile.contentsToByteArray()) } catch (e: IOException) { - LOG.warn("Failed to save image", e) + logger.warn("Failed to save image", e) } } @@ -45,8 +46,9 @@ class SaveImageAction : DumbAwareAction() { override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT companion object { - private val LOG = thisLogger() private const val IMAGE_FORMAT = "png" private const val IMAGE_DEFAULT_NAME: String = "myimg" } -} \ No newline at end of file +} + +private val logger = Logger.getInstance(SaveImageAction::class.java) \ No newline at end of file