Class ExtendedPatternFormatter

  • All Implemented Interfaces:
    Formatter

    public class ExtendedPatternFormatter
    extends PatternFormatter
    Formatter especially designed for debugging applications. This formatter extends the standard PatternFormatter to add two new possible expansions. These expansions are %{method} and %{thread}. In both cases the context map is first checked for values with specified key. This is to facilitate passing information about caller/thread when threads change (as in AsyncLogTarget). They then attempt to determine appropriate information dynamically.
    Version:
    CVS $Revision: 1.16 $ $Date: 2004/02/28 11:31:24 $
    Author:
    Avalon Development Team, Peter Donald
    • Constructor Detail

      • ExtendedPatternFormatter

        public ExtendedPatternFormatter​(java.lang.String format)
        Creation of a new extended pattern formatter.
        Parameters:
        format - the format string
      • ExtendedPatternFormatter

        public ExtendedPatternFormatter​(java.lang.String format,
                                        int callStackOffset)
        Creation of a new extended pattern formatter.
        Parameters:
        format - the format string
        callStackOffset - the offset
    • Method Detail

      • getTypeIdFor

        protected int getTypeIdFor​(java.lang.String type)
        Retrieve the type-id for a particular string.
        Overrides:
        getTypeIdFor in class PatternFormatter
        Parameters:
        type - the string
        Returns:
        the type-id
      • getMethod

        private java.lang.String getMethod​(LogEvent event)
        Utility method to format category.
        Parameters:
        event - the event
        Returns:
        the formatted string
      • getThread

        private java.lang.String getThread​(LogEvent event)
        Utility thread to format category.
        Parameters:
        event - the even
        Returns:
        the formatted string