*) Adding additional loglevel finer + finest according to Thread http://www.yacy-forum.de/viewtopic.php?p=8750#8750

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@618 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent fa54b5f38d
commit 60e77dcc60

@ -57,6 +57,8 @@ public final class serverLog {
public static final int LOGLEVEL_CONFIG = Level.CONFIG.intValue(); // regular system status information (i.e. start-up messages)
public static final int LOGLEVEL_INFO = Level.INFO.intValue(); // regular action information (i.e. any httpd request URL)
public static final int LOGLEVEL_FINE = Level.FINE.intValue(); // in-function status debug output
public static final int LOGLEVEL_FINER = Level.FINER.intValue(); // in-function status debug output
public static final int LOGLEVEL_FINEST = Level.FINEST.intValue(); // in-function status debug output
// these categories are also present as character tokens
public static final char LOGTOKEN_ZERO = 'Z';
@ -65,6 +67,8 @@ public final class serverLog {
public static final char LOGTOKEN_CONFIG = 'S';
public static final char LOGTOKEN_INFO = 'I';
public static final char LOGTOKEN_FINE = 'D';
public static final char LOGTOKEN_FINER = 'D';
public static final char LOGTOKEN_FINEST = 'D';
private final Logger theLogger;
@ -92,6 +96,12 @@ public final class serverLog {
public void logFine(String message) {this.theLogger.fine(message);}
public void logFine(String message, Throwable thrown) {this.theLogger.log(Level.FINE,message,thrown);}
public void logFiner(String message) {this.theLogger.finer(message);}
public void logFiner(String message, Throwable thrown) {this.theLogger.log(Level.FINER,message,thrown);}
public void logFinest(String message) {this.theLogger.finest(message);}
public void logFinest(String message, Throwable thrown) {this.theLogger.log(Level.FINEST,message,thrown);}
// static log messages: log everything
private static void log(String appName, int messageLevel, String message) {
Logger.getLogger(appName).log(Level.parse(Integer.toString(messageLevel)),message);
@ -124,11 +134,26 @@ public final class serverLog {
Logger.getLogger(appName).log(Level.INFO,message,thrown);
}
public static void logFine(String appName, String message) {
Logger.getLogger(appName).finest(message);
Logger.getLogger(appName).fine(message);
}
public static void logFine(String appName, String message, Throwable thrown) {
Logger.getLogger(appName).log(Level.FINEST,message,thrown);
Logger.getLogger(appName).log(Level.FINER,message,thrown);
}
public static void logFiner(String appName, String message) {
Logger.getLogger(appName).finer(message);
}
public static void logFiner(String appName, String message, Throwable thrown) {
Logger.getLogger(appName).log(Level.FINER,message,thrown);
}
public static void logFinest(String appName, String message) {
Logger.getLogger(appName).finest(message);
}
public static void logFinest(String appName, String message, Throwable thrown) {
Logger.getLogger(appName).log(Level.FINEST,message,thrown);
}
public static final void configureLogging(File loggingConfigFile) throws SecurityException, FileNotFoundException, IOException {
FileInputStream fileIn = null;
try {

@ -33,8 +33,6 @@ public class serverSimpleLogFormatter extends SimpleFormatter {
int logLevel = record.getLevel().intValue();
if (logLevel == serverLog.LOGLEVEL_SEVERE)
this.buffer.append(serverLog.LOGTOKEN_SEVERE);
else if (logLevel == serverLog.LOGLEVEL_SEVERE)
this.buffer.append(serverLog.LOGTOKEN_SEVERE);
else if (logLevel == serverLog.LOGLEVEL_WARNING)
this.buffer.append(serverLog.LOGTOKEN_WARNING);
else if (logLevel == serverLog.LOGLEVEL_CONFIG)
@ -43,6 +41,10 @@ public class serverSimpleLogFormatter extends SimpleFormatter {
this.buffer.append(serverLog.LOGTOKEN_INFO);
else if (logLevel == serverLog.LOGLEVEL_FINE)
this.buffer.append(serverLog.LOGTOKEN_FINE);
else if (logLevel == serverLog.LOGLEVEL_FINER)
this.buffer.append(serverLog.LOGTOKEN_FINER);
else if (logLevel == serverLog.LOGLEVEL_FINEST)
this.buffer.append(serverLog.LOGTOKEN_FINEST);
else
this.buffer.append(serverLog.LOGTOKEN_FINE);
this.buffer.append(' ');

Loading…
Cancel
Save