-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a735485
commit 86fc781
Showing
3 changed files
with
47 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package temalab.logger; | ||
|
||
import java.io.PrintStream; | ||
|
||
public class PrintStreamLogger extends LoggerBase { | ||
protected PrintStream printStream = null; | ||
|
||
public void setPrintStream(PrintStream p){ | ||
printStream.close(); //TODO Cleaner | ||
printStream = p; | ||
} | ||
|
||
public PrintStreamLogger(){ | ||
printStream = System.err; | ||
} | ||
|
||
@Override | ||
public void debug(String label, String message){ | ||
printStream.println(getInfos("DEBUG")); | ||
} | ||
|
||
@Override | ||
public void info(String label, String message){ | ||
printStream.print(getInfos("INFO")); | ||
} | ||
|
||
@Override | ||
public void warning(String label, String message){ | ||
printStream.print(getInfos("WARNING")); | ||
} | ||
|
||
@Override | ||
public void error(String label, String message){ | ||
printStream.print(getInfos("ERROR")); | ||
} | ||
} |