franta-hg@16: /** franta-hg@16: * copy-image-resizer franta-hg@16: * Copyright © 2013 František Kučera (frantovo.cz) franta-hg@16: * franta-hg@16: * This program is free software: you can redistribute it and/or modify franta-hg@16: * it under the terms of the GNU General Public License as published by franta-hg@16: * the Free Software Foundation, either version 3 of the License, or franta-hg@16: * (at your option) any later version. franta-hg@16: * franta-hg@16: * This program is distributed in the hope that it will be useful, franta-hg@16: * but WITHOUT ANY WARRANTY; without even the implied warranty of franta-hg@16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the franta-hg@16: * GNU General Public License for more details. franta-hg@16: * franta-hg@16: * You should have received a copy of the GNU General Public License franta-hg@16: * along with this program. If not, see . franta-hg@16: */ franta-hg@16: package cz.frantovo.copyImageResizer.logging; franta-hg@16: franta-hg@16: import java.util.logging.Formatter; franta-hg@16: franta-hg@16: /** franta-hg@16: * franta-hg@16: * @author Ing. František Kučera (frantovo.cz) franta-hg@16: */ franta-hg@16: public abstract class AbstractFormatter extends Formatter { franta-hg@16: franta-hg@16: protected static String rpad(String s, int n) { franta-hg@16: if (n > 0) { franta-hg@16: return String.format("%1$-" + n + "s", s); franta-hg@16: } else { franta-hg@16: return s; franta-hg@16: } franta-hg@16: } franta-hg@16: franta-hg@16: private boolean printStacktrace = false; franta-hg@16: franta-hg@16: public boolean isPrintStacktrace() { franta-hg@16: return printStacktrace; franta-hg@16: } franta-hg@16: franta-hg@16: public void setPrintStacktrace(boolean printStacktrace) { franta-hg@16: this.printStacktrace = printStacktrace; franta-hg@16: } franta-hg@16: franta-hg@16: }