Package elki.logging

Class ErrorFormatter


  • public class ErrorFormatter
    extends java.util.logging.Formatter
    Format a log record for error output, including a stack trace if available.
    Since:
    0.5.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String NULLMSG
      Null error message.
      static java.lang.String[] PRUNE
      List of packages to prune from stack traces at the end.
    • Constructor Summary

      Constructors 
      Constructor Description
      ErrorFormatter()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void appendCauses​(java.lang.StringBuilder buf, java.lang.Throwable thrown)
      Append (pruned) stack traces for associated exceptions.
      java.lang.String format​(java.util.logging.LogRecord record)  
      • 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
    • Field Detail

      • PRUNE

        public static final java.lang.String[] PRUNE
        List of packages to prune from stack traces at the end. TODO: make configurable via logging.properties
      • NULLMSG

        private final java.lang.String NULLMSG
        Null error message.
    • Constructor Detail

      • ErrorFormatter

        public ErrorFormatter()
        Constructor.
    • Method Detail

      • format

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

        private void appendCauses​(java.lang.StringBuilder buf,
                                  java.lang.Throwable thrown)
        Append (pruned) stack traces for associated exceptions.
        Parameters:
        buf - Buffer to append to
        thrown - Throwable to format.