For IntelliJ IDEA and
Android Studio


/** Returns PatternParser used to parse the conversion string. Subclasses may override this to return a subclass of PatternParser which recognize custom conversion characters. @since 0.9.0 */ protected org.apache.log4j.helpers.PatternParser createPatternParser(String pattern) { return new org.apache.log4j.pattern.BridgePatternParser(pattern); }
/** * Abbreviate name in string buffer. * @param nameStart starting position of name to abbreviate. * @param buf string buffer containing name. */ protected final void abbreviate(final int nameStart, final StringBuffer buf) { abbreviator.abbreviate(nameStart, buf); } }
/** * {@inheritDoc} */ public void format(final Object obj, final StringBuffer output) { if (obj instanceof Date) { format((Date) obj, output); } super.format(obj, output); }
/** * Formats an event into a string buffer. * @param event event to format, may not be null. * @param toAppendTo string buffer to which the formatted event will be appended. May not be null. */ public abstract void format( final LoggingEvent event, final StringBuffer toAppendTo);
/** * Create new pattern converter. * @return pattern converter. */ public org.apache.log4j.helpers.PatternConverter parse() { return new BridgePatternConverter(pattern); } }
/** * Obtains an instance of PropertiesPatternConverter. * @param options options, may be null or first element contains name of property to format. * @return instance of PropertiesPatternConverter. */ public static PropertiesPatternConverter newInstance( final String[] options) { return new PropertiesPatternConverter(options); }
/** * Gets an instance of the class. * @param options pattern options, may be null. If first element is "short", * only the first line of the throwable will be formatted. * @return instance of class. */ public static ThrowableInformationPatternConverter newInstance( final String[] options) { return new ThrowableInformationPatternConverter(options); }
/** * Obtains an instance of RelativeTimePatternConverter. * @param options options, currently ignored, may be null. * @return instance of RelativeTimePatternConverter. */ public static RelativeTimePatternConverter newInstance( final String[] options) { return new RelativeTimePatternConverter(); }
/** * Obtains an instance of pattern converter. * @param options options, may be null. * @return instance of pattern converter. */ public static LoggerPatternConverter newInstance( final String[] options) { if ((options == null) || (options.length == 0)) { return INSTANCE; } return new LoggerPatternConverter(options); }
/** * Obtains an instance of pattern converter. * @param options options, may be null. * @return instance of pattern converter. */ public static DatePatternConverter newInstance( final String[] options) { return new DatePatternConverter(options); }
/** * Gets an instance of ClassNamePatternConverter. * @param options options, may be null. * @return instance of pattern converter. */ public static ClassNamePatternConverter newInstance( final String[] options) { return new ClassNamePatternConverter(options); }
/** * {@inheritDoc} */ public void format(final LoggingEvent event, final StringBuffer output) { synchronized(this) { df.format(event.timeStamp, output); } }
/** Return the message for this logging event. <p>Before serialization, the returned object is the message passed by the user to generate the logging event. After serialization, the returned value equals the String form of the message possibly after object rendering. @since 1.1 */ public Object getMessage() { if(message != null) { return message; } else { return getRenderedMessage(); } }
/** * Constructor. * @param name name of converter. * @param style style name for associated output. * @param options options, may be null, first element will be interpreted as an abbreviation pattern. */ protected NamePatternConverter( final String name, final String style, final String[] options) { super(name, style); if ((options != null) && (options.length > 0)) { abbreviator = NameAbbreviator.getAbbreviator(options[0]); } else { abbreviator = NameAbbreviator.getDefaultAbbreviator(); } }
/** Format event to string buffer. @param sbuf string buffer to receive formatted event, may not be null. @param e event to format, may not be null. */ public void format(final StringBuffer sbuf, final LoggingEvent e) { for (int i = 0; i < patternConverters.length; i++) { int startField = sbuf.length(); patternConverters[i].format(e, sbuf); patternFields[i].format(startField, sbuf); } }