Class LogFormatter


  • public class LogFormatter
    extends java.util.logging.Formatter
    Produces compact output format for prelude logs
    Author:
    Bob Travis
    • Constructor Summary

      Constructors 
      Constructor Description
      LogFormatter()
      Standard constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(java.util.logging.LogRecord record)  
      static java.lang.String insertDate​(java.lang.String pattern, long time)
      Static insertDate method will insert date fragments into a string based on '%x' pattern elements.
      void messageOnly​(boolean messageOnly)
      Make it possible to log stripped messages
      • 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()
        Standard constructor
    • Method Detail

      • messageOnly

        public void messageOnly​(boolean messageOnly)
        Make it possible to log stripped messages
      • format

        public java.lang.String format​(java.util.logging.LogRecord record)
        Specified by:
        format in class java.util.logging.Formatter
      • insertDate

        public static java.lang.String insertDate​(java.lang.String pattern,
                                                  long time)
        Static insertDate method will insert date fragments into a string based on '%x' pattern elements. Equivalents in SimpleDateFormatter patterns, with examples:
        • %Y YYYY 2003
        • %m MM 08
        • %x MMM Aug
        • %d dd 25
        • %H HH 14
        • %M mm 30
        • %S ss 35
        • %s SSS 123
        • %Z Z -0400
        Others:
        • %T Long.toString(time)
        • %% %