org.apache.lucene.util

## Class InfoStream

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

- All Implemented Interfaces:
    Closeable, AutoCloseable
  Direct Known Subclasses:
    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 and Description
    --- | ---
    `static InfoStream` | `NO_OUTPUT` Instance of InfoStream that does no logging at all.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InfoStream()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and 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 Detail

    - #### NO_OUTPUT

          public static final InfoStream NO_OUTPUT

      Instance of InfoStream that does no logging at all.

  - ### Constructor Detail

    - #### InfoStream

          public InfoStream()

  - ### Method Detail

    - #### 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()`

Copyright © 2000-2024 Apache Software Foundation. All Rights Reserved.