Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      If an exception is thrown by a rule during the parse, Digester will log a
      message containing the exception stack trace, even if debug==0. This is
      undesirable for two reasons:

      1. We might not want to log this, either because the application catches the
      exception and cleanly handles it (in which case, there's really no 'need to
      know'), or because the exception is part of the normal application flow (for
      example, a rule might throw an exception in order to prematurely terminate the
      parse.)

      2. By default, log() outputs to System.out. Applications that pipe output to
      System.out probably do not want stack traces going there.

      In my particular case, I have unit tests that intentionally send bad data
      through the digester, to validate that various Rule classes detect the bad data
      and throw the proper exceptions. It's distracting to see stack traces in the
      unit test report, for tests that did not fail.

      Workaround:
      Pass a dummy logging writer to the Digester via setWriter(), that outputs
      nothing if debug == 0.

      Suggestions:
      1. Change Digester to log exceptions only if debug > 0. Or create a debug level
      of -1 that logs nothing; this will fully preserve backward compatibility.
      2. Change the default log output stream from System.out to System.err

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Resolved Resolved Closed Closed
        1955d 2m 1 Henri Yandell 09/Mar/07 20:39
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Affects Version/s unspecified [ 12311647 ]
        Project Commons [ 12310458 ] Commons Digester [ 12310471 ]
        Key COM-10 DIGESTER-57
        Assignee Craig McClanahan [ craig.mcclanahan@sun.com ]
        Component/s Digester [ 12311111 ]
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 4553 12340161
        Hide
        Craig McClanahan added a comment -

        Digester has been modified to use the commons-logging wrapper around whatever
        your favorite logging package is, so you can now turn on and off the reporting
        of errors like this.

        Show
        Craig McClanahan added a comment - Digester has been modified to use the commons-logging wrapper around whatever your favorite logging package is, so you can now turn on and off the reporting of errors like this.
        David H. Martin created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            David H. Martin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development