2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.javascript.log4j;
23 import jalview.javascript.log4j.spi.LoggingEvent;
24 import jalview.javascript.log4j.spi.OptionHandler;
26 import org.apache.log4j.PatternLayout;
27 import org.apache.log4j.TTCCLayout;
29 public abstract class Layout implements OptionHandler
32 // Note that the line.separator property can be looked up even by
34 public final static String LINE_SEP = System
35 .getProperty("line.separator");
37 public final static int LINE_SEP_LEN = LINE_SEP.length();
40 * Implement this method to create your own layout format.
42 abstract public String format(LoggingEvent event);
45 * Returns the content type output by this layout. The base class returns
48 public String getContentType()
54 * Returns the header for the layout format. The base class returns
57 public String getHeader()
63 * Returns the footer for the layout format. The base class returns
66 public String getFooter()
72 * If the layout handles the throwable object contained within
73 * {@link LoggingEvent}, then the layout should return <code>false</code>.
74 * Otherwise, if the layout ignores throwable object, then the layout should
75 * return <code>true</code>. If ignoresThrowable is true, the appender is
76 * responsible for rendering the throwable.
78 * The {@link SimpleLayout}, {@link TTCCLayout}, {@link PatternLayout} all
79 * return <code>true</code>. The {@link org.apache.log4j.xml.XMLLayout}
80 * returns <code>false</code>.
84 abstract public boolean ignoresThrowable();