Example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry.console IApplicationLogConsole IApplicationLogConsole

List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry.console IApplicationLogConsole IApplicationLogConsole

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry.console IApplicationLogConsole IApplicationLogConsole.

Prototype

IApplicationLogConsole

Source Link

Usage

From source file:org.springframework.ide.eclipse.boot.dash.test.CloudFoundryApplicationHarness.java

private void streamOutput(String name) throws Exception {
    if (client != null) {
        IApplicationLogConsole logConsole = new IApplicationLogConsole() {

            @Override/*from   w  ww  .  ja v a2  s. c  om*/
            public void onMessage(LogMessage log) {
                System.out.println("%" + name + "-out: " + log.getMessage());
            }

            @Override
            public void onComplete() {
                System.out.println("%" + name + "-COMPLETE");
            }

            @Override
            public void onError(Throwable exception) {
                System.out.println("%" + name + "-ERROR: " + ExceptionUtil.getMessage(exception));
            }

        };
        Cancellation logToken = client.streamLogs(name, logConsole);
        onDispose((d) -> {
            logToken.dispose();
        });
    }
}