Class ProgressBarLogger

java.lang.Object
com.shaft.tools.io.internal.ProgressBarLogger
All Implemented Interfaces:
AutoCloseable

public class ProgressBarLogger extends Object implements AutoCloseable
Logs a lightweight terminal progress bar for long-running synchronous operations.

The progress bar runs on a virtual thread and is automatically closed when the operation completes via try-with-resources. ANSI styling is disabled in non-interactive runs and when cucumber.ansi-colors.disabled=true to keep CI logs readable.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new progress bar logger using the default element identification timeout.
    ProgressBarLogger(String taskName, int timeoutVal)
    Creates a new progress bar logger with a custom timeout.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Stops the background progress task and closes the progress bar stream.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProgressBarLogger

      public ProgressBarLogger(String taskName)
      Creates a new progress bar logger using the default element identification timeout.
      Parameters:
      taskName - user-friendly task label shown beside the progress bar
    • ProgressBarLogger

      public ProgressBarLogger(String taskName, int timeoutVal)
      Creates a new progress bar logger with a custom timeout.
      Parameters:
      taskName - user-friendly task label shown beside the progress bar
      timeoutVal - timeout in seconds used as the progress maximum
  • Method Details

    • close

      public void close()
      Stops the background progress task and closes the progress bar stream.
      Specified by:
      close in interface AutoCloseable