summaryrefslogtreecommitdiff
path: root/same/src/main/java/com/orbekk/same/StackTraceUtil.java
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-27 18:14:59 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-27 18:14:59 +0100
commit76b2dc36a008269c4e5af03e10d0587a03c2ba3b (patch)
tree25897017859ca1d89b1b09b3d7446821b7d3908e /same/src/main/java/com/orbekk/same/StackTraceUtil.java
parentaea82c6c2086c587382aa85cd3b4a862a89f8b55 (diff)
Hack collection.
– MyJsonRpcHttpClient: A JsonRpcHttpClient that uses Apache HttpComponents because of a HttpURLConnection bug in Android 2.2. Receives hack status because of nasty overloading. – Log4j-android doesn't like printing stack traces – convert them to string before logging.
Diffstat (limited to 'same/src/main/java/com/orbekk/same/StackTraceUtil.java')
-rw-r--r--same/src/main/java/com/orbekk/same/StackTraceUtil.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/same/src/main/java/com/orbekk/same/StackTraceUtil.java b/same/src/main/java/com/orbekk/same/StackTraceUtil.java
new file mode 100644
index 0000000..0c0c3d0
--- /dev/null
+++ b/same/src/main/java/com/orbekk/same/StackTraceUtil.java
@@ -0,0 +1,14 @@
+package com.orbekk.same;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.Writer;
+
+public class StackTraceUtil {
+ public static String throwableToString(Throwable t) {
+ Writer writer = new StringWriter();
+ PrintWriter printWriter = new PrintWriter(writer);
+ t.printStackTrace(printWriter);
+ return writer.toString();
+ }
+}