Class LogFormatter


  • public class LogFormatter
    extends java.util.logging.Formatter
    A slightly nicer formatter for Java util logging output Modified to write out logs to a specified file
    • Constructor Summary

      Constructors 
      Constructor Description
      LogFormatter()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(java.util.logging.LogRecord lr)
      The standard formatter uses a horrible multiline approach.
      static void init​(java.lang.String filename)
      Initialize logging by attaching this formatter to the root logger.
      • Methods inherited from class java.util.logging.Formatter

        formatMessage, getHead, getTail
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LogFormatter

        public LogFormatter()
    • Method Detail

      • format

        public java.lang.String format​(java.util.logging.LogRecord lr)
        The standard formatter uses a horrible multiline approach. A single line message is far more readable (and easier to post-process). Java 7 supports a (completely cryptic) format string, but we cook our own food here...
        Specified by:
        format in class java.util.logging.Formatter
      • init

        public static void init​(java.lang.String filename)
        Initialize logging by attaching this formatter to the root logger. If logs don't need to be written out, pass a null filename