public class SimpleBuildLogger extends Object implements BuildLogger
Constructor and Description |
---|
SimpleBuildLogger() |
Modifier and Type | Method and Description |
---|---|
String |
addBuildLogEntry(LogEntry logEntry)
Add a new build log entry.
|
String |
addBuildLogEntry(String logString)
Create a new build log entry from text to append to logs
|
String |
addBuildLogHeader(String logString,
boolean showBothBanner) |
String |
addErrorLogEntry(LogEntry logEntry)
Add a new build error log entry.
|
String |
addErrorLogEntry(String logString)
Add a new build error log entry from text.
|
void |
addErrorLogEntry(String logString,
Throwable e)
Adds an error log entry and each frame of the stack trace as a new error log entry
|
void |
clearBuildLog()
Reset the build log, ready for the next build
|
void |
close() |
List<LogEntry> |
getBuildLog()
Provide the latest build details (last 100 lines of logs).
|
List<LogEntry> |
getErrorLog()
Provide the latest error logs.
|
LogInterceptorStack |
getInterceptorStack() |
List<LogEntry> |
getLastNLogEntries(int n)
Provide the latest build details (last n lines of logs).
|
LogMutatorStack |
getMutatorStack() |
List<String> |
getStringErrorLogs() |
List<String> |
getStringLogs() |
long |
getTimeOfLastLog()
last time a log entry was added.
|
void |
stopStreamingBuildLogs()
Stop streaming any logs to the build logs file
|
@NotNull public List<LogEntry> getErrorLog()
BuildLogger
getErrorLog
in interface BuildLogger
LogEntry
s.public List<String> getStringErrorLogs()
getStringErrorLogs
in interface BuildLogger
@NotNull public List<LogEntry> getBuildLog()
BuildLogger
getBuildLog
in interface BuildLogger
LogEntry
s.@NotNull public List<LogEntry> getLastNLogEntries(int n)
BuildLogger
getLastNLogEntries
in interface BuildLogger
LogEntry
s.@NotNull public String addBuildLogEntry(@NotNull LogEntry logEntry)
BuildLogger
addBuildLogEntry
in interface BuildLogger
logEntry
- The data being loggedLogEntry.getUnstyledLog()
.@NotNull public String addErrorLogEntry(@NotNull LogEntry logEntry)
BuildLogger
addErrorLogEntry
in interface BuildLogger
logEntry
- The data being loggedLogEntry.getUnstyledLog()
.public String addBuildLogEntry(@NotNull String logString)
BuildLogger
addBuildLogEntry
in interface BuildLogger
logString
- text to create log entry fromLogEntry.getUnstyledLog()
.public String addBuildLogHeader(String logString, boolean showBothBanner)
addBuildLogHeader
in interface BuildLogger
public String addErrorLogEntry(String logString)
BuildLogger
addErrorLogEntry
in interface BuildLogger
logString
- The text to create log entry fromLogEntry.getUnstyledLog()
.public void addErrorLogEntry(String logString, @Nullable Throwable e)
BuildLogger
addErrorLogEntry
in interface BuildLogger
public void clearBuildLog()
BuildLogger
clearBuildLog
in interface BuildLogger
public void stopStreamingBuildLogs()
BuildLogger
stopStreamingBuildLogs
in interface BuildLogger
public long getTimeOfLastLog()
BuildLogger
getTimeOfLastLog
in interface BuildLogger
@NotNull public LogInterceptorStack getInterceptorStack()
getInterceptorStack
in interface BuildLogger
@NotNull public LogMutatorStack getMutatorStack()
getMutatorStack
in interface BuildLogger
public void close()
close
in interface BuildLogger
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.