| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.view.textclassifier; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
public final class Log { |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
static final boolean ENABLE_FULL_LOGGING = |
| 35 |
android.util.Log.isLoggable(TextClassifier.LOG_TAG, android.util.Log.VERBOSE); |
| 36 |
|
| 37 |
private Log() { |
| 38 |
} |
| 39 |
|
| 40 |
public static void v(String tag, String msg) { |
| 41 |
if (ENABLE_FULL_LOGGING) { |
| 42 |
android.util.Log.v(tag, msg); |
| 43 |
} |
| 44 |
} |
| 45 |
|
| 46 |
public static void d(String tag, String msg) { |
| 47 |
android.util.Log.d(tag, msg); |
| 48 |
} |
| 49 |
|
| 50 |
public static void w(String tag, String msg) { |
| 51 |
android.util.Log.w(tag, msg); |
| 52 |
} |
| 53 |
|
| 54 |
public static void e(String tag, String msg, Throwable tr) { |
| 55 |
if (ENABLE_FULL_LOGGING) { |
| 56 |
android.util.Log.e(tag, msg, tr); |
| 57 |
} else { |
| 58 |
final String trString = (tr != null) ? tr.getClass().getSimpleName() : "??"; |
| 59 |
android.util.Log.d(tag, String.format("%s (%s)", msg, trString)); |
| 60 |
} |
| 61 |
} |
| 62 |
} |