View Javadoc

1   package ch.qos.logback.classic.pattern;
2   
3   import ch.qos.logback.classic.PatternLayout;
4   import ch.qos.logback.classic.spi.LoggingEvent;
5   import ch.qos.logback.core.CoreConstants;
6   
7   
8   
9   /**
10   * Always returns an empty string.
11   * <p>
12   * This converter is useful to pretend that the converter chain for
13   * PatternLayout actually handles exceptions, when in fact it does not.
14   * By adding %nopex to the conversion pattern, the user can bypass
15   * the automatic addition of %ex conversion pattern for patterns 
16   * which do not contain a converter handling exceptions.
17   * 
18   * <p>Users can ignore the existence of this converter, unless they
19   * want to suppress the automatic printing of exceptions by 
20   * {@link PatternLayout}.
21   * 
22   * @author Ceki G&uuml;lc&uuml;
23   */
24  public class NopThrowableInformationConverter extends ThrowableHandlingConverter {
25  
26    public String convert(LoggingEvent event) {
27      return CoreConstants.EMPTY_STRING;
28    }
29   
30  }