org.apache.nutch.util
Class LogFormatter

java.lang.Object
  extended byjava.util.logging.Formatter
      extended byorg.apache.nutch.util.LogFormatter

public class LogFormatter
extends Formatter

Prints just the date and the log message.


Constructor Summary
LogFormatter()
           
 
Method Summary
 String format(LogRecord record)
          Format the given LogRecord.
static Logger getLogger(String name)
          Gets a logger and, as a side effect, installs this as the default formatter.
static PrintStream getLogStream(Logger logger, Level level)
          Returns a stream that, when written to, adds log lines.
static boolean hasLoggedSevere()
          Returns true if this LogFormatter has logged something at Level.SEVERE
static void setShowThreadIDs(boolean showThreadIDs)
          When set true, thread IDs are logged.
static void showTime(boolean showTime)
          When true, time is logged with each entry.
 
Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFormatter

public LogFormatter()
Method Detail

getLogger

public static Logger getLogger(String name)
Gets a logger and, as a side effect, installs this as the default formatter.


showTime

public static void showTime(boolean showTime)
When true, time is logged with each entry.


setShowThreadIDs

public static void setShowThreadIDs(boolean showThreadIDs)
When set true, thread IDs are logged.


format

public String format(LogRecord record)
Format the given LogRecord.

Parameters:
record - the log record to be formatted.
Returns:
a formatted log record

hasLoggedSevere

public static boolean hasLoggedSevere()
Returns true if this LogFormatter has logged something at Level.SEVERE


getLogStream

public static PrintStream getLogStream(Logger logger,
                                       Level level)
Returns a stream that, when written to, adds log lines.



Copyright © 2006 The Apache Software Foundation