26 lines
738 B
Java
26 lines
738 B
Java
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
|
|
package graphicChat.logger;
|
|
|
|
import java.util.Date;
|
|
import java.util.logging.Formatter;
|
|
import java.util.logging.LogRecord;
|
|
|
|
/**
|
|
*
|
|
* @author chris
|
|
*/
|
|
public class MyFormatter extends Formatter {
|
|
|
|
@Override
|
|
public String format(LogRecord lr) {
|
|
String date = String.format("%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS %1$Tp", new Date(lr.getMillis()));
|
|
String s = ("| ")+lr.getMillis()+(" | ")+date+(" | ")+lr.getLevel().toString()+(" | ")+lr.getSourceClassName()+(" | ")+lr.getMessage()+(" | ")+"\n";
|
|
return s;
|
|
}
|
|
|
|
} |