Rice Pastry API

rice.environment.logging
Class LogOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byrice.environment.logging.LogOutputStream

public class LogOutputStream
extends java.io.OutputStream

This class constructs an output stream that will send its output to a logger, line by line. This could for example be wrapped in a PrintStream to capture stdout or stderr to the log. As so: System.setOut(new PrintStream(new LogOutputStream(environment, Logger.INFO, "out"), true)); System.setErr(new PrintStream(new LogOutputStream(environment, Logger.INFO, "err"), true));

Version:
$Id: pretty.settings 2305 2005-03-11 20:22:33Z jeffh $
Author:
jstewart

Field Summary
protected  byte[] buffer
          DESCRIBE THE FIELD
static int BUFFER_SIZE
          DESCRIBE THE FIELD
protected  int level
          DESCRIBE THE FIELD
protected  Logger logger
          DESCRIBE THE FIELD
protected  int offset
          DESCRIBE THE FIELD
 
Constructor Summary
LogOutputStream(Environment env, int level)
          Constructs a LogOutputStream
LogOutputStream(Environment env, int level, java.lang.String instance)
          Constructs a LogOutputStream
 
Method Summary
 void close()
          DESCRIBE THE METHOD
 void flush()
          DESCRIBE THE METHOD
 void write(int b)
          DESCRIBE THE METHOD
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Logger logger
DESCRIBE THE FIELD


buffer

protected byte[] buffer
DESCRIBE THE FIELD


offset

protected int offset
DESCRIBE THE FIELD


level

protected int level
DESCRIBE THE FIELD


BUFFER_SIZE

public static final int BUFFER_SIZE
DESCRIBE THE FIELD

See Also:
Constant Field Values
Constructor Detail

LogOutputStream

public LogOutputStream(Environment env,
                       int level)
Constructs a LogOutputStream

Parameters:
env - - the environment to log to
level - - the log level of this OutputStream's messages

LogOutputStream

public LogOutputStream(Environment env,
                       int level,
                       java.lang.String instance)
Constructs a LogOutputStream

Parameters:
env - - the environment to log to
level - - the log level of this OutputStream's messages
instance - - an instance name string for disambiguation
Method Detail

write

public void write(int b)
           throws java.io.IOException
DESCRIBE THE METHOD

Parameters:
b - DESCRIBE THE PARAMETER
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION

flush

public void flush()
DESCRIBE THE METHOD


close

public void close()
DESCRIBE THE METHOD


Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection