Skip to content

Commit

Permalink
something specific for gcloud testing
Browse files Browse the repository at this point in the history
Signed-off-by: olivier lamy <[email protected]>
  • Loading branch information
olamy committed Apr 1, 2017
1 parent fc51c1a commit 061f8ba
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.eclipse.jetty.util.log.Logger;
import org.mortbay.jetty.load.generator.LoadGenerator;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.InetAddress;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
Expand Down Expand Up @@ -88,7 +90,16 @@ public void onCommit( Request request )
@Override
public void onFailure( Request request, Throwable failure )
{
LOGGER.warn( "fail to send request", failure );
// gcloud log doesn't show stack trace to turn it to a String
LOGGER.warn( "fail to send request {}", toString( failure ) );
}

private String toString(Throwable t)
{
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter( sw);
t.printStackTrace(pw);
return sw.getBuffer().toString();
}

private static class ValueDisplayRunnable
Expand Down

0 comments on commit 061f8ba

Please sign in to comment.