Class BuildLogUtils


  • public class BuildLogUtils
    extends Object
    Provides text parsing utilities for writing and reading build log files.
    • Method Detail

      • convertToLogFileEntry

        public static String convertToLogFileEntry​(@NotNull
                                                   @NotNull LogEntry logEntry)
        Convert the specified LogEntry object into a string to be written to a log file
        Parameters:
        logEntry - the LogEntry to be written
        Returns:
        String file entry, should never be empty
      • getLogEntryType

        @NotNull
        public static @NotNull Class<? extends LogEntry> getLogEntryType​(@NotNull
                                                                         @NotNull String logLine)
        Return the specific type of LogEntry for the given log line.
      • convertToLogEntry

        @NotNull
        public static @NotNull LogEntry convertToLogEntry​(@Nullable
                                                          @Nullable String fileEntry)
        Converts a line from a file back into a LogEntry object
        Parameters:
        fileEntry - to be converted
        Returns:
        the resulting LogEntry object
      • convertSpecsLogToLogEntry

        @NotNull
        public static @NotNull LogEntry convertSpecsLogToLogEntry​(@Nullable
                                                                  @Nullable String rawLogEntry)
        Converts a line from a specs execution log file into a LogEntry object
        Parameters:
        rawLogEntry - specs execution log line to be converted
        Returns:
        the resulting LogEntry object
      • isSpecsLogEntryWithDate

        public static boolean isSpecsLogEntryWithDate​(@NotNull
                                                      @NotNull String[] split)
        Returns:
        true if date is present in given log split, false otherwise (for pre 6.10 logs)
      • splitLogEntry

        @Internal
        @NotNull
        public static @NotNull String[] splitLogEntry​(@Nullable
                                                      @Nullable String fileEntry)
      • splitSpecsLogEntry

        @Internal
        @NotNull
        public static @NotNull String[] splitSpecsLogEntry​(@Nullable
                                                           @Nullable String rawLogEntry)
      • skipLines

        public static void skipLines​(int numLogs,
                                     int totalLines,
                                     org.apache.commons.io.LineIterator lineIterator)
        Skips lines until only numLogs remains in the give lineIterator.