Search in sources :

Example 1 with LogListener

use of com.intellij.remoteServer.agent.util.log.LogListener 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 2 with LogListener

use of com.intellij.remoteServer.agent.util.log.LogListener 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

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