Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[*] reverted to the previous banner image
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.