Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-6222

Ability to shunt irrelevant and verbose logs in tests

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 5.4
    • None
    • testing
    • None

      In some tests, irrelevant loggers are pretty verbose. eg when using slf4j-simple and extending RepositoryTestCase, we get a ton of Jackrabbit logging that isn't necessarily helpful.
      In several tests of core, we already do this

      // Silence log4j completely
      org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.OFF);
      

      or this

      // Silence log4j for a specific category
      org.apache.log4j.Logger.getLogger(org.apache.commons.digester.Digester.class).setLevel(org.apache.log4j.Level.OFF);
      

      This adds a simple method in TestUtil which does this for both log4j and slf4j-simple.

        Acceptance criteria

              gjoseph Magnolia International
              gjoseph Magnolia International
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD