There's only two ways, imho. Depends on how lazy you are, which you choose.
The "correct" way to format output or exception details would to be well formatted and easily read. I'd say this definitely precludes throwing it blindly in a code block, as that results in idiotic random syntax formatting:

UGH! People should be shot for that.
If your output doesn't have any tabbed formatting or require monospace in order to be easily read, then using a quote is sufficient
04-28 09:26:55.935: E/AndroidRuntime(1437): FATAL EXCEPTION: main
04-28 09:26:55.935: E/AndroidRuntime(1437): Process:
com.neurondigital.HighwaySpeed, PID: 1437 04-28 09:26:55.935:
E/AndroidRuntime(1437): java.lang.RuntimeException: Unable to start
activity
ComponentInfo{com.neurondigital.HighwaySpeed/com.neurondigital.HighwaySpeed.HighwaySpeed}:
java.lang.NullPointerException 04-28 09:26:55.935:
E/AndroidRuntime(1437): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
Note, you probably will have to use a double space " " at the end of each line to enforce line breaks.
Alternatively, if you don't want to work that hard, or if your output has formatting or horizontal columns or something else that requires monospaced font to make it easily readable, place it in a code block but after turning off syntax highlighting using <!-- language: lang-none -->
. The following is formatted as code so you can see how it works. See this answer for more information.
<!-- language: lang-none -->
SEVERE: Exception loading sessions from persistent storage
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException:
bean.ProjectAreaBean
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333)
which results in
SEVERE: Exception loading sessions from persistent storage
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException:
bean.ProjectAreaBean
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333)