| 3 | import android.util.Log; |
| 4 | |
| 5 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected