Search in sources :

Example 1 with LoggingHandler

use of com.intellij.remoteServer.runtime.log.LoggingHandler in project intellij-community by JetBrains.

the class CloudDeploymentRuntime method deploy.

public void deploy(ServerRuntimeInstance.DeploymentOperationCallback callback) {
    try {
        CloudRemoteApplication application = deploy();
        DeploymentLogManager logManager = getLogManager();
        if (logManager != null) {
            LoggingHandler loggingHandler = logManager.getMainLoggingHandler();
            loggingHandler.print("Application is available at ");
            loggingHandler.printHyperlink(application.getWebUrl());
            loggingHandler.print("\n");
        }
        callback.succeeded(this);
    } catch (ServerRuntimeException e) {
        callback.errorOccurred(e.getMessage());
    }
}
Also used : LoggingHandler(com.intellij.remoteServer.runtime.log.LoggingHandler) CloudRemoteApplication(com.intellij.remoteServer.agent.util.CloudRemoteApplication) DeploymentLogManager(com.intellij.remoteServer.runtime.deployment.DeploymentLogManager)

Example 2 with LoggingHandler

use of com.intellij.remoteServer.runtime.log.LoggingHandler in project intellij-community by JetBrains.

the class CloudLoggingHandlerImpl method getOrCreateLogListener.

@Override
public LogListener getOrCreateLogListener(String pipeName) {
    LogListener logListener = myPipeName2LogListener.get(pipeName);
    if (logListener == null) {
        final LoggingHandler loggingHandler = myLogManager.addAdditionalLog(pipeName);
        logListener = new LogListenerImpl(loggingHandler);
        myPipeName2LogListener.put(pipeName, logListener);
    }
    return logListener;
}
Also used : CloudAgentLoggingHandler(com.intellij.remoteServer.agent.util.CloudAgentLoggingHandler) LoggingHandler(com.intellij.remoteServer.runtime.log.LoggingHandler) LogListener(com.intellij.remoteServer.agent.util.log.LogListener)

Example 3 with LoggingHandler

use of com.intellij.remoteServer.runtime.log.LoggingHandler in project intellij-community by JetBrains.

the class CloudLoggingHandlerImpl method createConsole.

@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);
        }
    };
}
Also used : CloudAgentLoggingHandler(com.intellij.remoteServer.agent.util.CloudAgentLoggingHandler) LoggingHandler(com.intellij.remoteServer.runtime.log.LoggingHandler) LogListener(com.intellij.remoteServer.agent.util.log.LogListener) OutputStream(java.io.OutputStream) ProcessHandler(com.intellij.execution.process.ProcessHandler) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

LoggingHandler (com.intellij.remoteServer.runtime.log.LoggingHandler)3 CloudAgentLoggingHandler (com.intellij.remoteServer.agent.util.CloudAgentLoggingHandler)2 LogListener (com.intellij.remoteServer.agent.util.log.LogListener)2 ProcessHandler (com.intellij.execution.process.ProcessHandler)1 CloudRemoteApplication (com.intellij.remoteServer.agent.util.CloudRemoteApplication)1 DeploymentLogManager (com.intellij.remoteServer.runtime.deployment.DeploymentLogManager)1 OutputStream (java.io.OutputStream)1 Nullable (org.jetbrains.annotations.Nullable)1