Class LogFormatter


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

      • LogFormatter

        public LogFormatter()
    • Method Detail

      • format

        public String format​(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 Formatter
      • init

        public static void init​(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