|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.bureau.util.BureauLogRedirector
public class BureauLogRedirector
Captures the output of a bureau and redirects it into a single logger instance using a thread
name equal to the bureau id. The Logger instance is the one for this class. The intent
is that log4j will be configured to use %t (thread name) to embed the bureau id.
| Field Summary | |
|---|---|
protected String |
_bureauId
|
protected int |
_limit
|
protected BufferedReader |
_reader
|
protected static Logger |
_target
|
protected boolean |
_truncated
|
protected int |
_written
|
| Constructor Summary | |
|---|---|
BureauLogRedirector(String bureauId,
InputStream input)
Creates a new redirector with no size limit. |
|
BureauLogRedirector(String bureauId,
InputStream input,
int limit)
Creates a new redirector. |
|
| Method Summary | |
|---|---|
protected void |
copyLoop()
|
String |
getBureauId()
Gets the bureau id this was created with. |
int |
getLimit()
Gets the character limit associated with the log. |
int |
getWritten()
Gets the total number of characters written to the log. |
boolean |
isRunning()
Returns true if the redirector is still active. |
boolean |
isTruncated()
Tests if this redirector has stopped copying lines due to the size limit being exceeded. |
void |
reset(int limit)
Resets the redirector's truncation status and allows additional output up to the given character limit. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String _bureauId
protected BufferedReader _reader
protected int _limit
protected int _written
protected boolean _truncated
protected static Logger _target
| Constructor Detail |
|---|
public BureauLogRedirector(String bureauId,
InputStream input)
bureauId - the id of the bureau being redirected - this will become the thread nameinput - the stream that is the output of the bureau process
public BureauLogRedirector(String bureauId,
InputStream input,
int limit)
bureauId - the id of the bureau being redirected - this will become the thread nameinput - the stream that is the output of the bureau processlimit - approximate limit for the total characters written to the logger| Method Detail |
|---|
public String getBureauId()
public int getWritten()
public int getLimit()
public void reset(int limit)
public boolean isTruncated()
public boolean isRunning()
protected void copyLoop()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||