MCPcopy Create free account
hub / github.com/aritraroy/UltimateAndroidReference / Logger

Class Logger

others/Logger.java:5–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import android.util.Log;
4
5public class Logger {
6
7 private final String TAG;
8 private final int priority;
9
10 public static Logger withTag(String tag) {
11 return new Logger(tag);
12 }
13
14 private Logger(String TAG) {
15 this.TAG = TAG;
16 this.priority = Log.DEBUG;
17 }
18
19 public Logger log(String message) {
20 if (BuildConfig.DEBUG) {
21 Log.println(priority, TAG, message);
22 }
23 return this;
24 }
25
26 public void withCause(Exception cause) {
27 if (BuildConfig.DEBUG) {
28 Log.println(priority, TAG, Log.getStackTraceString(cause));
29 }
30 }
31}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected