Class Logger
- java.lang.Object
-
- de.unistuttgart.informatik.fius.icge.log.Logger
-
public abstract class Logger extends Object
Helper class that interceptsSystem.out
andSystem.err
and allows to attach multiple streams to capture the outputs of intercepted streams.- Version:
- 2.0
- Author:
- Tim Neumann, Tobias Wältken, Fabian Bühler
-
-
Field Summary
Fields Modifier and Type Field Description static PrintStream
error
The error logger printing toSystem.err
static PrintStream
out
The main logger printing toSystem.out
-
Constructor Summary
Constructors Constructor Description Logger()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
addErrorOutputStream(OutputStream stream)
Function to add aOutputStream
to the error loggerstatic boolean
addOutOutputStream(OutputStream stream)
Function to add aOutputStream
to the out loggerstatic void
clearErrorOutputStream()
Clears the error OutputStreamsstatic void
clearOutOutputStream()
Clears the out OutputStreamsstatic boolean
removeErrorOutputStream(OutputStream stream)
Function to remove aOutputStream
from the error loggerstatic boolean
removeOutOutputStream(OutputStream stream)
Function to remove aOutputStream
from the out logger
-
-
-
Field Detail
-
out
public static PrintStream out
The main logger printing toSystem.out
-
error
public static PrintStream error
The error logger printing toSystem.err
-
-
Method Detail
-
addOutOutputStream
public static boolean addOutOutputStream(OutputStream stream)
Function to add aOutputStream
to the out logger- Parameters:
stream
- TheOutputStream
to add- Returns:
- Returns true if successfull
- See Also:
OutputStreamMultiplier.addOutputStream(OutputStream)
-
removeOutOutputStream
public static boolean removeOutOutputStream(OutputStream stream)
Function to remove aOutputStream
from the out logger- Parameters:
stream
- TheOutputStream
to remove- Returns:
- Returns true if successfull
- See Also:
OutputStreamMultiplier.removeOutputStream(OutputStream)
-
clearOutOutputStream
public static void clearOutOutputStream()
Clears the out OutputStreams
-
addErrorOutputStream
public static boolean addErrorOutputStream(OutputStream stream)
Function to add aOutputStream
to the error logger- Parameters:
stream
- TheOutputStream
to add- Returns:
- Returns true if successfull
- See Also:
OutputStreamMultiplier.addOutputStream(OutputStream)
-
removeErrorOutputStream
public static boolean removeErrorOutputStream(OutputStream stream)
Function to remove aOutputStream
from the error logger- Parameters:
stream
- TheOutputStream
to remove- Returns:
- Returns true if successfull
- See Also:
OutputStreamMultiplier.removeOutputStream(OutputStream)
-
clearErrorOutputStream
public static void clearErrorOutputStream()
Clears the error OutputStreams
-
-