Skip to content

Commit

Permalink
fix log level check
Browse files Browse the repository at this point in the history
  • Loading branch information
djih committed Oct 20, 2015
1 parent 1e54e18 commit e7e0f3c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/com/amplitude/api/AmplitudeLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ AmplitudeLog setLogLevel(int logLevel) {
}

int d(String tag, String msg) {
if (enableLogging && logLevel >= Log.DEBUG) return Log.d(tag, msg);
if (enableLogging && logLevel <= Log.DEBUG) return Log.d(tag, msg);
return 0;
}

int d(String tag, String msg, Throwable tr) {
if (enableLogging && logLevel >= Log.DEBUG) return Log.d(tag, msg, tr);
if (enableLogging && logLevel <= Log.DEBUG) return Log.d(tag, msg, tr);
return 0;
}

int e(String tag, String msg) {
if (enableLogging && logLevel >= Log.ERROR) return Log.e(tag, msg);
if (enableLogging && logLevel <= Log.ERROR) return Log.e(tag, msg);
return 0;
}

int e(String tag, String msg, Throwable tr) {
if (enableLogging && logLevel >= Log.ERROR) return Log.e(tag, msg, tr);
if (enableLogging && logLevel <= Log.ERROR) return Log.e(tag, msg, tr);
return 0;
}

Expand All @@ -53,12 +53,12 @@ String getStackTraceString(Throwable tr) {
}

int i(String tag, String msg) {
if (enableLogging && logLevel >= Log.INFO) return Log.i(tag, msg);
if (enableLogging && logLevel <= Log.INFO) return Log.i(tag, msg);
return 0;
}

int i(String tag, String msg, Throwable tr) {
if (enableLogging && logLevel >= Log.INFO) return Log.i(tag, msg, tr);
if (enableLogging && logLevel <= Log.INFO) return Log.i(tag, msg, tr);
return 0;
}

Expand All @@ -71,43 +71,43 @@ int println(int priority, String tag, String msg) {
}

int v(String tag, String msg) {
if (enableLogging && logLevel >= Log.VERBOSE) return Log.v(tag, msg);
if (enableLogging && logLevel <= Log.VERBOSE) return Log.v(tag, msg);
return 0;
}

int v(String tag, String msg, Throwable tr) {
if (enableLogging && logLevel >= Log.VERBOSE) return Log.v(tag, msg, tr);
if (enableLogging && logLevel <= Log.VERBOSE) return Log.v(tag, msg, tr);
return 0;
}

int w(String tag, String msg) {
if (enableLogging && logLevel >= Log.WARN) return Log.w(tag, msg);
if (enableLogging && logLevel <= Log.WARN) return Log.w(tag, msg);
return 0;
}

int w(String tag, Throwable tr) {
if (enableLogging && logLevel >= Log.WARN) return Log.w(tag, tr);
if (enableLogging && logLevel <= Log.WARN) return Log.w(tag, tr);
return 0;
}

int w(String tag, String msg, Throwable tr) {
if (enableLogging && logLevel >= Log.WARN) return Log.w(tag, msg, tr);
if (enableLogging && logLevel <= Log.WARN) return Log.w(tag, msg, tr);
return 0;
}

// wtf = What a Terrible Failure, logged at level ASSERT
int wtf(String tag, String msg) {
if (enableLogging && logLevel >= Log.ASSERT) return Log.wtf(tag, msg);
if (enableLogging && logLevel <= Log.ASSERT) return Log.wtf(tag, msg);
return 0;
}

int wtf(String tag, Throwable tr) {
if (enableLogging && logLevel >= Log.ASSERT) return Log.wtf(tag, tr);
if (enableLogging && logLevel <= Log.ASSERT) return Log.wtf(tag, tr);
return 0;
}

int wtf(String tag, String msg, Throwable tr) {
if (enableLogging && logLevel >= Log.ASSERT) return Log.wtf(tag, msg, tr);
if (enableLogging && logLevel <= Log.ASSERT) return Log.wtf(tag, msg, tr);
return 0;
}
}

0 comments on commit e7e0f3c

Please sign in to comment.