Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HSEARCH-1658 Expose configuration to enable Lucene Infostream
- Loading branch information
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
engine/src/main/java/org/hibernate/search/util/logging/impl/LoggerInfoStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Hibernate Search, full-text search for your domain model | ||
* | ||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later | ||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
*/ | ||
package org.hibernate.search.util.logging.impl; | ||
|
||
import org.apache.lucene.util.InfoStream; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* An implementation of {@link org.apache.lucene.util.InfoStream} | ||
* that redirects output to a logger | ||
*/ | ||
public class LoggerInfoStream extends InfoStream { | ||
|
||
private final Log logger = LoggerFactory.make(); | ||
|
||
@Override | ||
public void message(String component, String message) { | ||
logger.logInfoStreamMessage( component, message ); | ||
} | ||
|
||
@Override | ||
public boolean isEnabled(String component) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { } | ||
} |