public class LogWriter extends Writer
Constructor and Description |
---|
LogWriter(int priority,
String tag)
Create a new Writer that sends to the log with the given priority
and tag.
|
LogWriter(int priority,
String tag,
int buffer) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the stream, flushing it first.
|
void |
flush()
Flushes the stream.
|
void |
write(char[] buf,
int offset,
int count)
Writes a portion of an array of characters.
|
public LogWriter(int priority, String tag)
priority
- The desired log priority:
Log.VERBOSE
,
Log.DEBUG
,
Log.INFO
,
Log.WARN
, or
Log.ERROR
.tag
- A string tag to associate with each printed log statement.public LogWriter(int priority, String tag, int buffer)
public void close()
Writer
public void flush()
Writer
If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
public void write(char[] buf, int offset, int count)
Writer