org.apache.turbine.services.logging
Class LogWriter

java.lang.Object
  |
  +--java.io.Writer
        |
        +--java.io.PrintWriter
              |
              +--org.apache.turbine.services.logging.LogWriter

public class LogWriter
extends java.io.PrintWriter

An adapter for integrating external code (e.g., J2EE) that expects a simple PrintWriter for logging.

Version:
$Id$
Author:
Christopher Elkins

Field Summary
private  LoggingService logger
           
 
Fields inherited from class java.io.PrintWriter
autoFlush, lineSeparator, out, trouble
 
Fields inherited from class java.io.Writer
lock, writeBuffer, writeBufferSize
 
Constructor Summary
LogWriter()
          Default constructor.
 
Method Summary
 boolean checkError()
          Flush the stream and check its error state.
 void close()
          Close the stream.
 void flush()
          Flush the stream.
 Logger getLogger()
          This method returns default logger for Turbine System
 Logger getLogger(java.lang.String logName)
          This method returns logger with given name if such logger exsists, or the default logger.
private  void log(java.lang.String message)
          Logs the specified message.
 void print(boolean b)
          Print a boolean.
 void print(char c)
          Print a character.
 void print(char[] s)
          Print an array of characters.
 void print(double d)
          Print a double-precision floating-point number.
 void print(float f)
          Print a floating-point number.
 void print(int i)
          Print an integer.
 void print(long l)
          Print a long integer.
 void print(java.lang.Object obj)
          Print an object.
 void print(java.lang.String s)
          Print a string.
 void println()
          Terminate the current line by writing the line separator string.
 void println(boolean x)
          Print a boolean value and then terminate the line.
 void println(char x)
          Print a character and then terminate the line.
 void println(char[] x)
          Print an array of characters and then terminate the line.
 void println(double x)
          Print a double-precision floating-point number and then terminate the line.
 void println(float x)
          Print a floating-point number and then terminate the line.
 void println(int x)
          Print an integer and then terminate the line.
 void println(long x)
          Print a long integer and then terminate the line.
 void println(java.lang.Object x)
          Print an Object and then terminate the line.
 void println(java.lang.String x)
          Print a String and then terminate the line.
 void setFormat(java.lang.String format)
          This method sets format style of the default logger.
 void setFormat(java.lang.String logName, java.lang.String format)
          This method sets format style of the given logger.
 void setLogLevel(int level)
          This method sets the log level in default logger
 void setLogLevel(java.lang.String logName, int level)
          This method sets the log level in the logger of given name
 void write(char[] buf)
          Write an array of characters.
 void write(char[] buf, int off, int len)
          Write a portion of an array of characters.
 void write(int c)
          Write a single character.
 void write(java.lang.String s)
          Write a string.
 void write(java.lang.String s, int off, int len)
          Write a portion of a string.
 
Methods inherited from class java.io.PrintWriter
ensureOpen, newLine, setError
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

logger

private LoggingService logger
Constructor Detail

LogWriter

public LogWriter()
Default constructor.
Method Detail

log

private void log(java.lang.String message)
Logs the specified message.

flush

public void flush()
Flush the stream.
Overrides:
flush in class java.io.PrintWriter

close

public void close()
Close the stream.
Overrides:
close in class java.io.PrintWriter

checkError

public boolean checkError()
Flush the stream and check its error state.
Overrides:
checkError in class java.io.PrintWriter

write

public void write(int c)
Write a single character.
Overrides:
write in class java.io.PrintWriter

write

public void write(char[] buf,
                  int off,
                  int len)
Write a portion of an array of characters.
Overrides:
write in class java.io.PrintWriter

write

public void write(char[] buf)
Write an array of characters.
Overrides:
write in class java.io.PrintWriter

write

public void write(java.lang.String s,
                  int off,
                  int len)
Write a portion of a string.
Overrides:
write in class java.io.PrintWriter

write

public void write(java.lang.String s)
Write a string.
Overrides:
write in class java.io.PrintWriter

print

public void print(boolean b)
Print a boolean.
Overrides:
print in class java.io.PrintWriter

print

public void print(char c)
Print a character.
Overrides:
print in class java.io.PrintWriter

print

public void print(int i)
Print an integer.
Overrides:
print in class java.io.PrintWriter

print

public void print(long l)
Print a long integer.
Overrides:
print in class java.io.PrintWriter

print

public void print(float f)
Print a floating-point number.
Overrides:
print in class java.io.PrintWriter

print

public void print(double d)
Print a double-precision floating-point number.
Overrides:
print in class java.io.PrintWriter

print

public void print(char[] s)
Print an array of characters.
Overrides:
print in class java.io.PrintWriter

print

public void print(java.lang.String s)
Print a string.
Overrides:
print in class java.io.PrintWriter

print

public void print(java.lang.Object obj)
Print an object.
Overrides:
print in class java.io.PrintWriter

println

public void println()
Terminate the current line by writing the line separator string.
Overrides:
println in class java.io.PrintWriter

println

public void println(boolean x)
Print a boolean value and then terminate the line.
Overrides:
println in class java.io.PrintWriter

println

public void println(char x)
Print a character and then terminate the line.
Overrides:
println in class java.io.PrintWriter

println

public void println(int x)
Print an integer and then terminate the line.
Overrides:
println in class java.io.PrintWriter

println

public void println(long x)
Print a long integer and then terminate the line.
Overrides:
println in class java.io.PrintWriter

println

public void println(float x)
Print a floating-point number and then terminate the line.
Overrides:
println in class java.io.PrintWriter

println

public void println(double x)
Print a double-precision floating-point number and then terminate the line.
Overrides:
println in class java.io.PrintWriter

println

public void println(char[] x)
Print an array of characters and then terminate the line.
Overrides:
println in class java.io.PrintWriter

println

public void println(java.lang.String x)
Print a String and then terminate the line.
Overrides:
println in class java.io.PrintWriter

println

public void println(java.lang.Object x)
Print an Object and then terminate the line.
Overrides:
println in class java.io.PrintWriter

getLogger

public Logger getLogger()
This method returns default logger for Turbine System
Returns:
The default logger for system.

getLogger

public Logger getLogger(java.lang.String logName)
This method returns logger with given name if such logger exsists, or the default logger.

setLogLevel

public void setLogLevel(int level)
This method sets the log level in default logger

setLogLevel

public void setLogLevel(java.lang.String logName,
                        int level)
This method sets the log level in the logger of given name

setFormat

public void setFormat(java.lang.String format)
This method sets format style of the default logger. Format tokens are described in RunDataFilter implementation.
Parameters:
format - String describing what information should be extracted from RunData
See Also:
BaseRunDataFilter

setFormat

public void setFormat(java.lang.String logName,
                      java.lang.String format)
This method sets format style of the given logger. Format tokens are described in RunDataFilter implementation.
Parameters:
format - String describing what information should be extracted from RunData
See Also:
BaseRunDataFilter


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.