Kleine Änderungen am Logger

This commit is contained in:
JanUlrich 2014-10-13 10:39:14 +02:00
parent b31f770fe3
commit c62c31db6d
3 changed files with 25 additions and 30 deletions

View File

@ -95,6 +95,7 @@ public class MyCompiler implements MyCompilerAPI
* Author: J<EFBFBD>rg B<EFBFBD>uerle<br/>
* Der private Konstruktor. Es soll von au<EFBFBD>en kein Compiler angelegt werden
* k<EFBFBD>nnen, sondern nur eine API zur Verf<EFBFBD>gung gestellt werden.
* @param logger Konfiguration für Debug Ausgabe TODO
*/
// ino.end
// ino.method.MyCompiler.21283.definition

View File

@ -2,7 +2,9 @@ package de.dhbwstuttgart.logger;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
public class Logger {
@ -75,5 +77,26 @@ public class Logger {
public static void setStandardOutput(PrintStream outputStream) {
Logger.standardOutput = outputStream;
}
}
class OutputHandler extends Handler{
private PrintStream output;
public OutputHandler(PrintStream output){
this.output = output;
}
@Override
public void publish(LogRecord record) {
output.println(record.getMessage());
}
@Override
public void flush() {
}
@Override
public void close() throws SecurityException {
}
}

View File

@ -1,29 +0,0 @@
package de.dhbwstuttgart.logger;
import java.io.PrintStream;
import java.util.logging.Handler;
import java.util.logging.LogRecord;
public class OutputHandler extends Handler{
private PrintStream output;
public OutputHandler(PrintStream output){
this.output = output;
}
@Override
public void publish(LogRecord record) {
output.println(record.getMessage());
}
@Override
public void flush() {
}
@Override
public void close() throws SecurityException {
}
}