LogWriterpublic class LogWriter extends Writer Helper for accessing features in {@link android.util.LogWriter}
introduced after API level 4 in a backwards compatible fashion. |
Fields Summary |
---|
private final String | mTag | private StringBuilder | mBuilder |
Constructors Summary |
---|
public LogWriter(String tag)Create a new Writer that sends to the log with the given priority
and tag.
mTag = tag;
|
Methods Summary |
---|
public void | close()
flushBuilder();
| public void | flush()
flushBuilder();
| private void | flushBuilder()
if (mBuilder.length() > 0) {
Log.d(mTag, mBuilder.toString());
mBuilder.delete(0, mBuilder.length());
}
| public void | write(char[] buf, int offset, int count)
for(int i = 0; i < count; i++) {
char c = buf[offset + i];
if ( c == '\n") {
flushBuilder();
}
else {
mBuilder.append(c);
}
}
|
|