PrintStreamInfoStream (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.util, class: PrintStreamInfoStream

Package org.apache.lucene.util

# Class PrintStreamInfoStream

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

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

public class PrintStreamInfoStream extends InfoStream
InfoStream implementation over a `PrintStream` such as `System.out`.

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
  `protected final int`
  `messageID`
  `protected final PrintStream`
  `stream`

  ### Fields inherited from class org.apache.lucene.util.InfoStream

  `NO_OUTPUT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PrintStreamInfoStream(PrintStream stream)`
  `PrintStreamInfoStream(PrintStream stream, int messageID)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `protected String`
  `getTimestamp()`
  Returns the current time as string for insertion into log messages.
  `boolean`
  `isEnabled(String component)`
  returns true if messages are enabled and should be posted to `InfoStream.message(java.lang.String, java.lang.String)`.
  `boolean`
  `isSystemStream()`
  `void`
  `message(String component, String message)`
  prints a message

  ### Methods inherited from class org.apache.lucene.util.InfoStream

  `getDefault, setDefault`

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

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

- ## Field Details

  - ### messageID

    protected final int messageID

  - ### stream

    protected final PrintStream stream

- ## Constructor Details

  - ### PrintStreamInfoStream

    public PrintStreamInfoStream(PrintStream stream)

  - ### PrintStreamInfoStream

    public PrintStreamInfoStream(PrintStream stream, int messageID)

- ## Method Details

  - ### message

    public void message(String component, String message)
    Description copied from class: `InfoStream`
    prints a message
    Specified by:
      `message` in class `InfoStream`

  - ### isEnabled

    public boolean isEnabled(String component)
    Description copied from class: `InfoStream`
    returns true if messages are enabled and should be posted to `InfoStream.message(java.lang.String, java.lang.String)`.
    Specified by:
      `isEnabled` in class `InfoStream`

  - ### close

    public void close() throws IOException
    Throws:
      `IOException`

  - ### isSystemStream

    public boolean isSystemStream()

  - ### getTimestamp

    protected String getTimestamp()
    Returns the current time as string for insertion into log messages.