Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1047

Undocumented replacement of ch.qos.logback.core.joran.spi.Pattern with ElementSelector

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 1.0.13, 1.1.0, 1.1.1, 1.1.2
    • logback-site
    • None

    Description

      The chapter about Joran still cites using Pattern class, while it was replaced by ElementSelector:

      package ch.qos.logback.core.joran.action;
      
      import org.xml.sax.Attributes;
      import ch.qos.logback.core.joran.spi.ExecutionContext;
      
      public abstract class Action {
        /**
         * Called when the parser encounters an element matching a
         * {@link ch.qos.logback.core.joran.spi.Pattern Pattern}.
         */
        public abstract void begin(InterpretationContext ic, String name,
            Attributes attributes) throws ActionException;
      
        /**
         * Called to pass the body (as text) contained within an element.
         */
        public void body(InterpretationContext ic, String body)
            throws ActionException {
          // NOP
        }
      
        /*
         * Called when the parser encounters an endElement event matching a
         * {@link ch.qos.logback.core.joran.spi.Pattern Pattern}.
         */
        public abstract void end(InterpretationContext ic, String name)
            throws ActionException;
      }
      

      The class should be ch.qos.logback.core.joran.spi.ElementSelector.

      Also, this change, which happened in v1.0.13 is not documented anywhere, which makes migrating code depending on the older versions hard.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            ivant Ivan Toshkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: