mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-129347 - Heroku: bash console
This commit is contained in:
+4
@@ -17,6 +17,8 @@ package com.intellij.remoteServer.agent.util;
|
||||
|
||||
import com.intellij.remoteServer.agent.util.log.LogListener;
|
||||
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* @author michael.golubev
|
||||
*/
|
||||
@@ -25,4 +27,6 @@ public interface CloudAgentLoggingHandler {
|
||||
void println(String message);
|
||||
|
||||
LogListener getOrCreateLogListener(String pipeName);
|
||||
|
||||
LogListener createConsole(String pipeName, OutputStream consoleInput);
|
||||
}
|
||||
|
||||
+2
-2
@@ -45,11 +45,11 @@ public class CloudGitApplicationRuntime extends CloudApplicationRuntime {
|
||||
myDeployment = serverRuntime.getAgent().createDeployment(applicationName, myLoggingHandler);
|
||||
}
|
||||
|
||||
protected CloudMultiSourceServerRuntimeInstance getServerRuntime() {
|
||||
public CloudMultiSourceServerRuntimeInstance getServerRuntime() {
|
||||
return myServerRuntime;
|
||||
}
|
||||
|
||||
protected DeploymentLogManager getLogManager() {
|
||||
public DeploymentLogManager getLogManager() {
|
||||
return myLogManager;
|
||||
}
|
||||
|
||||
|
||||
+39
@@ -15,11 +15,14 @@
|
||||
*/
|
||||
package com.intellij.remoteServer.util;
|
||||
|
||||
import com.intellij.execution.process.ProcessHandler;
|
||||
import com.intellij.remoteServer.agent.util.CloudAgentLoggingHandler;
|
||||
import com.intellij.remoteServer.agent.util.log.LogListener;
|
||||
import com.intellij.remoteServer.runtime.deployment.DeploymentLogManager;
|
||||
import com.intellij.remoteServer.runtime.log.LoggingHandler;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
@@ -60,4 +63,40 @@ public class CloudLoggingHandlerImpl implements CloudAgentLoggingHandler {
|
||||
}
|
||||
return logListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LogListener createConsole(String pipeName, final OutputStream consoleInput) {
|
||||
final LoggingHandler loggingHandler = myLogManager.addAdditionalLog(pipeName);
|
||||
loggingHandler.attachToProcess(new ProcessHandler() {
|
||||
|
||||
@Override
|
||||
protected void destroyProcessImpl() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void detachProcessImpl() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean detachIsDefault() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public OutputStream getProcessInput() {
|
||||
return consoleInput;
|
||||
}
|
||||
});
|
||||
|
||||
return new LogListener() {
|
||||
|
||||
@Override
|
||||
public void lineLogged(String line) {
|
||||
loggingHandler.print(line);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -4,6 +4,8 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.remoteServer.agent.util.CloudAgentLoggingHandler;
|
||||
import com.intellij.remoteServer.agent.util.log.LogListener;
|
||||
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* @author michael.golubev
|
||||
*/
|
||||
@@ -20,4 +22,9 @@ public class CloudSilentLoggingHandlerImpl implements CloudAgentLoggingHandler {
|
||||
public LogListener getOrCreateLogListener(String pipeName) {
|
||||
return LogListener.NULL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LogListener createConsole(String pipeName, OutputStream consoleInput) {
|
||||
return LogListener.NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user