From 60e77dcc60f50f6dc580f4eb0e0c6531ae67b080 Mon Sep 17 00:00:00 2001 From: theli Date: Tue, 30 Aug 2005 22:37:48 +0000 Subject: [PATCH] *) 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 --- .../de/anomic/server/logging/serverLog.java | 29 +++++++++++++++++-- .../logging/serverSimpleLogFormatter.java | 6 ++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/source/de/anomic/server/logging/serverLog.java b/source/de/anomic/server/logging/serverLog.java index 1fb5550d5..bac496c79 100644 --- a/source/de/anomic/server/logging/serverLog.java +++ b/source/de/anomic/server/logging/serverLog.java @@ -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 { diff --git a/source/de/anomic/server/logging/serverSimpleLogFormatter.java b/source/de/anomic/server/logging/serverSimpleLogFormatter.java index 6dafa13b1..7727c05d2 100644 --- a/source/de/anomic/server/logging/serverSimpleLogFormatter.java +++ b/source/de/anomic/server/logging/serverSimpleLogFormatter.java @@ -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(' ');