Skip to content

Commit

Permalink
handle null objects
Browse files Browse the repository at this point in the history
  • Loading branch information
yamin-elmakis committed Nov 21, 2017
1 parent 73ce450 commit 9253894
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions easyloglib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 17
targetSdkVersion 23
versionCode 3
versionName "1.3"
versionCode 4
versionName "1.4"
}
buildTypes {
release {
Expand Down
20 changes: 10 additions & 10 deletions easyloglib/src/main/java/lib/yamin/easylog/EasyLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ public static void v() {

public static void v(Object msg) {
if (showLogs) {
logV(msg.toString(), null);
logV(msg == null ? "null" : msg.toString(), null);
}
}

public static void v(Object msg, Throwable throwable) {
if (showLogs) {
logV(msg.toString(), throwable);
logV(msg == null ? "null" : msg.toString(), throwable);
}
}

Expand All @@ -69,13 +69,13 @@ public static void d() {

public static void d(Object msg) {
if (showLogs) {
logD(msg.toString(), null);
logD(msg == null ? "null" : msg.toString(), null);
}
}

public static void d(Object msg, Throwable throwable) {
if (showLogs) {
logD(msg.toString(), throwable);
logD(msg == null ? "null" : msg.toString(), throwable);
}
}

Expand All @@ -98,13 +98,13 @@ public static void i() {

public static void i(Object msg) {
if (showLogs) {
logI(msg.toString(), null);
logI(msg == null ? "null" : msg.toString(), null);
}
}

public static void i(Object msg, Throwable throwable) {
if (showLogs) {
logI(msg.toString(), throwable);
logI(msg == null ? "null" : msg.toString(), throwable);
}
}

Expand All @@ -127,13 +127,13 @@ public static void w() {

public static void w(Object msg) {
if (showLogs) {
logW(msg.toString(), null);
logW(msg == null ? "null" : msg.toString(), null);
}
}

public static void w(Object msg, Throwable throwable) {
if (showLogs) {
logW(msg.toString(), throwable);
logW(msg == null ? "null" : msg.toString(), throwable);
}
}

Expand All @@ -156,13 +156,13 @@ public static void e() {

public static void e(Object msg) {
if (showLogs) {
logE(msg.toString(), null);
logE(msg == null ? "null" : msg.toString(), null);
}
}

public static void e(Object msg, Throwable throwable) {
if (showLogs) {
logE(msg.toString(), throwable);
logE(msg == null ? "null" : msg.toString(), throwable);
}
}

Expand Down

0 comments on commit 9253894

Please sign in to comment.