Skip to content

Commit

Permalink
Merge pull request orhanobut#59 from hrskrs/minorImprovements
Browse files Browse the repository at this point in the history
Minor improvements
  • Loading branch information
orhanobut committed Feb 15, 2016
2 parents b41c071 + 3109fd9 commit 9cb4fa7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion logger/src/main/java/com/orhanobut/logger/LoggerPrinter.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.orhanobut.logger;

import android.text.TextUtils;
import android.util.Log;

import org.json.JSONArray;
import org.json.JSONException;
Expand Down Expand Up @@ -116,7 +117,7 @@ final class LoggerPrinter implements Printer {

@Override public void e(Throwable throwable, String message, Object... args) {
if (throwable != null && message != null) {
message += " : " + throwable.toString();
message += " : " + Log.getStackTraceString(throwable);
}
if (throwable != null && message == null) {
message = throwable.toString();
Expand Down Expand Up @@ -154,6 +155,7 @@ final class LoggerPrinter implements Printer {
return;
}
try {
json = json.trim();
if (json.startsWith("{")) {
JSONObject jsonObject = new JSONObject(json);
String message = jsonObject.toString(JSON_INDENT);
Expand Down

0 comments on commit 9cb4fa7

Please sign in to comment.