java/copy-image-resizer/src/cz/frantovo/copyImageResizer/logging/ColorfulConsoleFormatter.java
changeset 16 4634176c6602
parent 8 4819598eb623
     1.1 --- a/java/copy-image-resizer/src/cz/frantovo/copyImageResizer/logging/ColorfulConsoleFormatter.java	Mon Nov 17 20:38:38 2014 +0100
     1.2 +++ b/java/copy-image-resizer/src/cz/frantovo/copyImageResizer/logging/ColorfulConsoleFormatter.java	Mon Nov 17 21:58:52 2014 +0100
     1.3 @@ -20,7 +20,6 @@
     1.4  import cz.frantovo.copyImageResizer.logging.ColorfulPrintWriter.TerminalColor;
     1.5  import cz.frantovo.copyImageResizer.logging.ColorfulPrintWriter.TerminalStyle;
     1.6  import java.io.StringWriter;
     1.7 -import java.util.logging.Formatter;
     1.8  import java.util.logging.Level;
     1.9  import java.util.logging.LogRecord;
    1.10  
    1.11 @@ -29,9 +28,7 @@
    1.12   *
    1.13   * @author Ing. František Kučera (frantovo.cz)
    1.14   */
    1.15 -public class ColorfulConsoleFormatter extends Formatter {
    1.16 -
    1.17 -	private boolean printStacktrace = false;
    1.18 +public class ColorfulConsoleFormatter extends AbstractFormatter {
    1.19  
    1.20  	@Override
    1.21  	public String format(LogRecord r) {
    1.22 @@ -71,7 +68,7 @@
    1.23  				out.print(": ");
    1.24  				out.print(message);
    1.25  			}
    1.26 -			if (printStacktrace) {
    1.27 +			if (isPrintStacktrace()) {
    1.28  				out.println();
    1.29  				out.setForegroundColor(TerminalColor.Yellow);
    1.30  				out.setStyle(TerminalStyle.Dim);
    1.31 @@ -80,21 +77,4 @@
    1.32  			}
    1.33  		}
    1.34  	}
    1.35 -
    1.36 -	public boolean isPrintStacktrace() {
    1.37 -		return printStacktrace;
    1.38 -	}
    1.39 -
    1.40 -	public void setPrintStacktrace(boolean printStacktrace) {
    1.41 -		this.printStacktrace = printStacktrace;
    1.42 -	}
    1.43 -
    1.44 -	private static String rpad(String s, int n) {
    1.45 -		if (n > 0) {
    1.46 -			return String.format("%1$-" + n + "s", s);
    1.47 -		} else {
    1.48 -			return s;
    1.49 -		}
    1.50 -	}
    1.51 -
    1.52  }