MCPcopy Create free account
hub / github.com/LineageOS/android_frameworks_base / LogPrinter

Class LogPrinter

core/java/android/util/LogPrinter.java:23–59  ·  view source on GitHub ↗

Implementation of a android.util.Printer that sends its output to the system log.

Source from the content-addressed store, hash-verified

21 * to the system log.
22 */
23public class LogPrinter implements Printer {
24 private final int mPriority;
25 private final String mTag;
26 private final int mBuffer;
27
28 /**
29 * Create a new Printer that sends to the log with the given priority
30 * and tag.
31 *
32 * @param priority The desired log priority:
33 * {@link android.util.Log#VERBOSE Log.VERBOSE},
34 * {@link android.util.Log#DEBUG Log.DEBUG},
35 * {@link android.util.Log#INFO Log.INFO},
36 * {@link android.util.Log#WARN Log.WARN}, or
37 * {@link android.util.Log#ERROR Log.ERROR}.
38 * @param tag A string tag to associate with each printed log statement.
39 */
40 public LogPrinter(int priority, String tag) {
41 mPriority = priority;
42 mTag = tag;
43 mBuffer = Log.LOG_ID_MAIN;
44 }
45
46 /**
47 * @hide
48 * Same as above, but buffer is one of the LOG_ID_ constants from android.util.Log.
49 */
50 public LogPrinter(int priority, String tag, int buffer) {
51 mPriority = priority;
52 mTag = tag;
53 mBuffer = buffer;
54 }
55
56 public void println(String x) {
57 Log.println_native(mBuffer, mPriority, mTag, x);
58 }
59}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected