apache / apache/lucene

Tests: Configure JUL logging based on VERBOSE flag [LUCENE-6189]

Open
#7,251 0 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Minor type:enhancement type:test
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

I propose that LuceneTestCase check if VERBOSE is false, and if so then do this: `Logger.getLogger("org.apache.lucene").setLevel(Level.SEVERE)`.

This will allow test classes to grab a logger and log to it at appropriate levels without having to guard each log line with `if (VERBOSE) ...`

---
Migrated from [LUCENE-6189](https://issues.apache.org/jira/browse/LUCENE-6189) by David Smiley (@dsmiley)

Contributor guide

Open the contributing guide

Research direction

Start in LuceneTestCase and inspect how the VERBOSE flag is handled during test setup. Configure the org.apache.lucene logger for non-verbose runs as described, then verify that tests still pass and that verbose runs retain their logging.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.