Package org.jfree.util
Class PrintStreamLogTarget
- java.lang.Object
-
- org.jfree.util.PrintStreamLogTarget
-
- All Implemented Interfaces:
java.io.Serializable
,LogTarget
public class PrintStreamLogTarget extends java.lang.Object implements LogTarget, java.io.Serializable
A log target that sends output to aPrintStream
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.PrintStream
printStream
The printstream we use ..private static long
serialVersionUID
For serialization.
-
Constructor Summary
Constructors Constructor Description PrintStreamLogTarget()
The default constructor.PrintStreamLogTarget(java.io.PrintStream printStream)
The default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
log(int level, java.lang.Object message)
Logs a message to the main log stream.void
log(int level, java.lang.Object message, java.lang.Exception e)
logs an message to the main-log stream.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
printStream
private java.io.PrintStream printStream
The printstream we use ..
-
-
Constructor Detail
-
PrintStreamLogTarget
public PrintStreamLogTarget()
The default constructor. Initializes this target with the system.out stream.All
LogTarget
implementations need a default constructor.
-
PrintStreamLogTarget
public PrintStreamLogTarget(java.io.PrintStream printStream)
The default constructor. Initializes this target with the given stream.- Parameters:
printStream
- the print stream that is used to write the content.
-
-
Method Detail
-
log
public void log(int level, java.lang.Object message)
Logs a message to the main log stream. All attached logStreams will also receive this message. If the given log-level is higher than the given debug-level in the main config file, no logging will be done.
-
log
public void log(int level, java.lang.Object message, java.lang.Exception e)
logs an message to the main-log stream. All attached logStreams will also receive this message. If the given log-level is higher than the given debug-level in the main config file, no logging will be done. The exception's stacktrace will be appended to the log-stream
-
-