@@ -9,7 +9,7 @@ import com.intellij.execution.process.ProcessHandler
9
9
import com.intellij.execution.runners.ExecutionEnvironment
10
10
import com.intellij.execution.util.ProgramParametersUtil
11
11
import com.intellij.openapi.application.readAction
12
- import com.intellij.openapi.diagnostic.Logger
12
+ import com.intellij.openapi.diagnostic.logger
13
13
import com.intellij.openapi.roots.ProjectRootManager
14
14
import com.intellij.openapi.util.text.StringUtil
15
15
import com.intellij.openapi.vfs.LocalFileSystem
@@ -24,7 +24,6 @@ import kotlin.io.path.Path
24
24
25
25
class PowerShellScriptCommandLineState (private val runConfiguration : PowerShellRunConfiguration , environment : ExecutionEnvironment ) :
26
26
CommandLineState (environment), RunProfileState {
27
- private val LOG = Logger .getInstance(" #" + javaClass.name)
28
27
29
28
lateinit var workingDirectory: Path
30
29
suspend fun prepareExecution () {
@@ -52,12 +51,12 @@ class PowerShellScriptCommandLineState(private val runConfiguration: PowerShellR
52
51
.withWorkDirectory(workingDirectory.toString())
53
52
54
53
runConfiguration.environmentVariables.configureCommandLine(commandLine, true )
55
- LOG .debug(" Command line: $command " )
56
- LOG .debug(" Environment: " + commandLine.environment.toString())
57
- LOG .debug(" Effective Environment: " + commandLine.effectiveEnvironment.toString())
54
+ logger .debug(" Command line: $command " )
55
+ logger .debug(" Environment: " + commandLine.environment.toString())
56
+ logger .debug(" Effective Environment: " + commandLine.effectiveEnvironment.toString())
58
57
return KillableColoredProcessHandler (commandLine)
59
58
} catch (e: PowerShellNotInstalled ) {
60
- LOG .warn(" Can not start PowerShell: ${e.message} " )
59
+ logger .warn(" Can not start PowerShell: ${e.message} " )
61
60
throw ExecutionException (e.message, e)
62
61
}
63
62
}
@@ -81,13 +80,16 @@ class PowerShellScriptCommandLineState(private val runConfiguration: PowerShellR
81
80
val p = matcher.group(i)
82
81
if (! StringUtil .isEmpty(p)) matchedParams.add(p)
83
82
} catch (e: IllegalStateException ) {
83
+ logger.error(e)
84
84
} catch (e: IndexOutOfBoundsException ) {
85
+ logger.error(e)
85
86
}
86
-
87
87
}
88
88
}
89
89
commandString.addAll(matchedParams)
90
90
}
91
91
return commandString
92
92
}
93
93
}
94
+
95
+ private val logger = logger<PowerShellScriptCommandLineState >()
0 commit comments