Class BuildLogUtils
java.lang.Object
com.atlassian.bamboo.build.logger.BuildLogUtils
Provides text parsing utilities for writing and reading build log files.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull LogEntryconvertSpecsLogToLogEntry(@Nullable String rawLogEntry) Converts a line from a specs execution log file into a LogEntry objectstatic @NotNull LogEntryconvertToLogEntry(@Nullable String fileEntry) Converts a line from a file back into a LogEntry objectstatic StringconvertToLogFileEntry(@NotNull LogEntry logEntry) Convert the specified LogEntry object into a string to be written to a log filegetLogEntryType(@NotNull String logLine) Return the specific type ofLogEntryfor the given log line.static booleanisSpecsLogEntryWithDate(@NotNull String[] split) static voidsendFileThroughLogger(@NotNull File file, @NotNull BuildLogger buildLogger) static voidskipLines(int numLogs, int totalLines, org.apache.commons.io.LineIterator lineIterator) Skips lines until onlynumLogsremains in the givelineIterator.static @NotNull String[]splitLogEntry(@Nullable String fileEntry) static @NotNull String[]splitSpecsLogEntry(@Nullable String rawLogEntry)
-
Method Details
-
convertToLogFileEntry
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 ofLogEntryfor the given log line. -
convertToLogEntry
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
- Returns:
- true if date is present in given log split, false otherwise (for pre 6.10 logs)
-
splitLogEntry
-
splitSpecsLogEntry
-
sendFileThroughLogger
public static void sendFileThroughLogger(@NotNull @NotNull File file, @NotNull @NotNull BuildLogger buildLogger) throws IOException - Throws:
IOException
-
skipLines
public static void skipLines(int numLogs, int totalLines, org.apache.commons.io.LineIterator lineIterator) Skips lines until onlynumLogsremains in the givelineIterator.
-