Package wsh.util

Class CleanFormatter


  • public class CleanFormatter
    extends java.util.logging.Formatter
    Format log messages without any extras.
    • Constructor Summary

      Constructors 
      Constructor Description
      CleanFormatter()  
    • 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 prependToLines​(java.lang.String prepend, java.lang.String lines)
      Prepend a string to every line of text in a String
      static void setWarningPrefix​(java.lang.String prefix)
      Prefix a string to all warnings or severe errors We use this method only for unit tests, to distinguish the source of warnings.
      • 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

      • CleanFormatter

        public CleanFormatter()
    • Method Detail

      • setWarningPrefix

        public static void setWarningPrefix​(java.lang.String prefix)
        Prefix a string to all warnings or severe errors We use this method only for unit tests, to distinguish the source of warnings.
        Parameters:
        prefix - new prefix for all lines
      • format

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

        public static java.lang.String prependToLines​(java.lang.String prepend,
                                                      java.lang.String lines)
        Prepend a string to every line of text in a String
        Parameters:
        prepend - String to be prepended
        lines - Lines separated by newline character, from System.getProperty("line.separator");
        Returns:
        Modified lines