Skip to content

Commit

Permalink
[+] added Logger Class tip
Browse files Browse the repository at this point in the history
[*] reverted to the previous banner image
  • Loading branch information
nisrulz committed Dec 2, 2016
1 parent aafdc21 commit f8f7f5f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Logger.java
@@ -0,0 +1,31 @@
package github.nisrulz.logger;

import android.util.Log;

public class Logger {

private final String TAG;
private final int priority;

public static Logger withTag(String tag) {
return new Logger(tag);
}

private Logger(String TAG) {
this.TAG = TAG;
this.priority = Log.DEBUG; // This could be ERROR / INFO / VERBOSE
}

public Logger log(String message) {
if (BuildConfig.DEBUG) {
Log.println(priority, TAG, message);
}
return this;
}

public void withCause(Exception cause) {
if (BuildConfig.DEBUG) {
Log.println(priority, TAG, Log.getStackTraceString(cause));
}
}
}
1 change: 1 addition & 0 deletions Readme.md
Expand Up @@ -450,6 +450,7 @@ Yes, vysor was great, but if you want to share your keyboard and mouse directly
```gradle
./gradlew test --offline
```
+ **Use an abtracted [Logger](/Logger.java) class**

-

Expand Down
Binary file modified img/github_banner.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f8f7f5f

Please sign in to comment.