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 LogEntry
convertSpecsLogToLogEntry
(@Nullable String rawLogEntry) Converts a line from a specs execution log file into a LogEntry objectstatic @NotNull LogEntry
convertToLogEntry
(@Nullable String fileEntry) Converts a line from a file back into a LogEntry objectstatic String
convertToLogFileEntry
(@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 ofLogEntry
for the given log line.static boolean
isSpecsLogEntryWithDate
(@NotNull String[] split) static void
sendFileThroughLogger
(@NotNull File file, @NotNull BuildLogger buildLogger) static void
skipLines
(int numLogs, int totalLines, org.apache.commons.io.LineIterator lineIterator) Skips lines until onlynumLogs
remains in the give
lineIterator
.
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 ofLogEntry
for 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 onlynumLogs
remains in the give
lineIterator
.
-