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

framework packages are not excluded properly

    XMLWordPrintable

Details

    Description

      The LoggerContext.getFrameworkPackages documentation says this is a list of packages (including their subpackages) that get excluded when tracing the caller.
      But the implementation in CallerData.isInFrameworkSpaceList is wrong because "com.foo" matches "com.foobar" which is not its subpackage.

      I suggest changing

      if (currentClass.startsWith(s))

      to

      if (currentClass.startsWith(s + "."))

      or even

      if (currentClass.equals(s) || currentClass.startsWith(s + "."))

      in case someone relies on this behavior to exclude specific classes (which would be nice anyway).

      We could also add

      if (s.equals("")) return !currentClass.contains(".")

      to support excluding the default package classes.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            bugr Bug Reporter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: