Skip to content

Commit

Permalink
Removed printStackTrace from main code and placed into logger so it c…
Browse files Browse the repository at this point in the history
…an be silenced if needed
  • Loading branch information
mat committed Feb 7, 2020
1 parent 2f8e6d7 commit 89cd69a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions rootbeerlib/src/main/java/com/scottyab/rootbeer/RootBeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private String[] propsReader() {
String propVal = new Scanner(inputstream).useDelimiter("\\A").next();
return propVal.split("\n");
} catch (IOException | NoSuchElementException e) {
e.printStackTrace();
QLog.e(e);
return null;
}
}
Expand All @@ -227,7 +227,7 @@ private String[] mountReader() {
String propVal = new Scanner(inputstream).useDelimiter("\\A").next();
return propVal.split("\n");
} catch (IOException | NoSuchElementException e) {
e.printStackTrace();
QLog.e(e);
return null;
}
}
Expand Down
16 changes: 6 additions & 10 deletions rootbeerlib/src/main/java/com/scottyab/rootbeer/util/QLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ public static void e(final Object obj) {
}
}

public static void e(final Exception e) {
if (isELoggable()) {
e.printStackTrace();
}
}

public static void w(final Object obj, final Throwable cause) {
if (isWLoggable()) {
Log.w(TAG, getTrace() + String.valueOf(obj));
Expand Down Expand Up @@ -122,16 +128,6 @@ private static String getTrace() {
+ lineNo + "] - ";
}

/**
* Prints the stack trace to mubaloo log and standard log
*
* @param e the exception to log
*/
public static void handleException(final Exception e) {
QLog.e(e.toString());
e.printStackTrace();
}

private QLog() {
}
}

0 comments on commit 89cd69a

Please sign in to comment.