Class ProgressLogger

java.lang.Object
net.fabricmc.loom.util.gradle.ProgressLogger

public class ProgressLogger extends Object
Wrapper to ProgressLogger internal API.
  • Method Details

    • getProgressFactory

      public static ProgressLogger getProgressFactory(org.gradle.api.Project project, String category)
      Get a Progress logger from the Gradle internal API.
      Parameters:
      project - The project
      category - The logger category
      Returns:
      In any case a progress logger
    • getDescription

      public String getDescription()
      Returns the description of the operation.
      Returns:
      the description, must not be empty.
    • setDescription

      public ProgressLogger setDescription(String description)
      Sets the description of the operation. This should be a full, stand-alone description of the operation.

      This must be called before started()

      Parameters:
      description - The description.
    • getShortDescription

      public String getShortDescription()
      Returns the short description of the operation. This is used in place of the full description when display space is limited.
      Returns:
      The short description, must not be empty.
    • setShortDescription

      public ProgressLogger setShortDescription(String description)
      Sets the short description of the operation. This is used in place of the full description when display space is limited.

      This must be called before started()

      Parameters:
      description - The short description.
    • getLoggingHeader

      public String getLoggingHeader()
      Returns the logging header for the operation. This is logged before any other log messages for this operation are logged. It is usually also logged at the end of the operation, along with the final status message. Defaults to null.

      If not specified, no logging header is logged.

      Returns:
      The logging header, possibly empty.
    • setLoggingHeader

      public ProgressLogger setLoggingHeader(String header)
      Sets the logging header for the operation. This is logged before any other log messages for this operation are logged. It is usually also logged at the end of the operation, along with the final status message. Defaults to null.
      Parameters:
      header - The header. May be empty or null.
    • start

      public ProgressLogger start(String description, String shortDescription)
      Convenience method that sets descriptions and logs started() event.
      Returns:
      this logger instance
    • started

      public void started()
      Logs the start of the operation, with no initial status.
    • started

      public void started(String status)
      Logs the start of the operation, with the given status.
      Parameters:
      status - The initial status message. Can be null or empty.
    • progress

      public void progress(String status)
      Logs some progress, indicated by a new status.
      Parameters:
      status - The new status message. Can be null or empty.
    • completed

      public void completed()
      Logs the completion of the operation, with no final status.
    • completed

      public void completed(String status)
      Logs the completion of the operation, with a final status. This is generally logged along with the description.
      Parameters:
      status - The final status message. Can be null or empty.