LogWriterpublic class LogWriter extends Writer
Fields Summary |
---|
private final int | mPriority | private final String | mTag | private final int | mBuffer | private StringBuilder | mBuilder |
Constructors Summary |
---|
public LogWriter(int priority, String tag)Create a new Writer that sends to the log with the given priority
and tag.
mPriority = priority;
mTag = tag;
mBuffer = Log.LOG_ID_MAIN;
| public LogWriter(int priority, String tag, int buffer)
mPriority = priority;
mTag = tag;
mBuffer = buffer;
|
Methods Summary |
---|
public void | close()
flushBuilder();
| public void | flush()
flushBuilder();
| private void | flushBuilder()
if (mBuilder.length() > 0) {
Log.println_native(mBuffer, mPriority, 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);
}
}
|
|