Package org.apache.lucene.util

# Class InfoStream

java.lang.Object
org.apache.lucene.util.InfoStream

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

Direct Known Subclasses:
  `JavaLoggingInfoStream`, `PrintStreamInfoStream`

public abstract class InfoStream extends Object implements Closeable
Debugging API for Lucene classes such as `IndexWriter` and `SegmentInfos`.

NOTE: Enabling infostreams may cause performance degradation in some components.

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final InfoStream`
`NO_OUTPUT`
Instance of InfoStream that does no logging at all.

## Constructor Summary

Constructors
Constructor
Description
`InfoStream()`

## Method Summary

Modifier and Type
Method
Description
`static InfoStream`
`getDefault()`
The default `InfoStream` used by a newly instantiated classes.
`abstract boolean`
`isEnabled(String component)`
returns true if messages are enabled and should be posted to `message(java.lang.String, java.lang.String)`.
`abstract void`
`message(String component, String message)`
prints a message
`static void`
`setDefault(InfoStream infoStream)`
Sets the default `InfoStream` used by a newly instantiated classes.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.io.Closeable

`close`

## Field Details

### NO_OUTPUT

public static final InfoStream NO_OUTPUT
Instance of InfoStream that does no logging at all.

## Constructor Details

### InfoStream

public InfoStream()

## Method Details

### message

public abstract void message(String component, String message)
prints a message

### isEnabled

public abstract boolean isEnabled(String component)
returns true if messages are enabled and should be posted to `message(java.lang.String, java.lang.String)`.

### getDefault

public static InfoStream getDefault()
The default `InfoStream` used by a newly instantiated classes.

See Also:
  - `setDefault(org.apache.lucene.util.InfoStream)`

### setDefault

public static void setDefault(InfoStream infoStream)
Sets the default `InfoStream` used by a newly instantiated classes. It cannot be `null`, to disable logging use `NO_OUTPUT`.

See Also:
  - `getDefault()`