public abstract class AbstractBuildLogger extends Object implements BuildLogger
Constructor and Description |
---|
AbstractBuildLogger(String linePrefix) |
Modifier and Type | Method and Description |
---|---|
@NotNull String |
addBuildLogEntry(@NotNull LogEntry logEntry)
Add a new build log entry.
|
@NotNull String |
addBuildLogEntry(@NotNull String logString)
Create a new build log entry from text to append to logs
|
@NotNull String |
addErrorLogEntry(@NotNull LogEntry logEntry)
Add a new build error log entry.
|
@NotNull String |
addErrorLogEntry(String logString)
Add a new build error log entry from text.
|
void |
addErrorLogEntry(String logString,
@Nullable Throwable e)
Adds an error log entry and each frame of the stack trace as a new error log entry
|
protected String |
addErrorLogEntryInternal(@NotNull LogEntry logEntry) |
protected @NotNull String |
addLogEntry(@NotNull LogEntry logEntry) |
void |
close() |
@NotNull List<LogEntry> |
getBuildLog() |
@NotNull List<LogEntry> |
getErrorLog() |
@NotNull LogInterceptorStack |
getInterceptorStack() |
@NotNull List<LogEntry> |
getLastNLogEntries(int n)
Provide the latest build details (last n lines of logs).
|
int |
getLogEntryCount()
Total number of log entries.
|
@NotNull LogMutatorStack |
getMutatorStack() |
long |
getTimeOfLastLog()
last time a log entry was added.
|
protected @NotNull LogEntry |
interceptAndMutate(@NotNull LogEntry logEntry) |
protected @NotNull LogEntry |
interceptAndMutateError(@NotNull LogEntry logEntry) |
abstract void |
onAddLogEntry(@NotNull LogEntry logEntry) |
void |
setTimeOfLastLog(long timeOfLastLog)
set time of last log.
|
abstract void |
stopStreamingBuildLogs()
Stop streaming any logs to the build logs file
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isPersistent, transfersLogsAsArtifact
public AbstractBuildLogger(String linePrefix)
public abstract void onAddLogEntry(@NotNull @NotNull LogEntry logEntry)
public abstract void stopStreamingBuildLogs()
BuildLoggerWithoutLogAccess
stopStreamingBuildLogs
in interface BuildLoggerWithoutLogAccess
public int getLogEntryCount()
BuildLogger
getLogEntryCount
in interface BuildLogger
@NotNull public @NotNull List<LogEntry> getLastNLogEntries(int n)
BuildLogger
getLastNLogEntries
in interface BuildLogger
LogEntry
s.@NotNull public @NotNull String addBuildLogEntry(@NotNull @NotNull LogEntry logEntry)
BuildLoggerWithoutLogAccess
addBuildLogEntry
in interface BuildLoggerWithoutLogAccess
logEntry
- The data being loggedLogEntry.getUnstyledLog()
.@NotNull public @NotNull String addErrorLogEntry(@NotNull @NotNull LogEntry logEntry)
BuildLoggerWithoutLogAccess
addErrorLogEntry
in interface BuildLoggerWithoutLogAccess
logEntry
- The data being loggedLogEntry.getUnstyledLog()
.protected String addErrorLogEntryInternal(@NotNull @NotNull LogEntry logEntry)
@NotNull protected @NotNull LogEntry interceptAndMutate(@NotNull @NotNull LogEntry logEntry)
@NotNull protected @NotNull LogEntry interceptAndMutateError(@NotNull @NotNull LogEntry logEntry)
@NotNull public @NotNull String addBuildLogEntry(@NotNull @NotNull String logString)
BuildLoggerWithoutLogAccess
addBuildLogEntry
in interface BuildLoggerWithoutLogAccess
logString
- text to create log entry fromLogEntry.getUnstyledLog()
.@NotNull public @NotNull String addErrorLogEntry(String logString)
BuildLoggerWithoutLogAccess
addErrorLogEntry
in interface BuildLoggerWithoutLogAccess
logString
- The text to create log entry fromLogEntry.getUnstyledLog()
.public void addErrorLogEntry(String logString, @Nullable @Nullable Throwable e)
BuildLoggerWithoutLogAccess
addErrorLogEntry
in interface BuildLoggerWithoutLogAccess
public long getTimeOfLastLog()
BuildLoggerWithoutLogAccess
getTimeOfLastLog
in interface BuildLoggerWithoutLogAccess
public void setTimeOfLastLog(long timeOfLastLog)
BuildLoggerWithoutLogAccess
setTimeOfLastLog
in interface BuildLoggerWithoutLogAccess
@NotNull public @NotNull LogInterceptorStack getInterceptorStack()
getInterceptorStack
in interface BuildLoggerWithoutLogAccess
@NotNull public @NotNull LogMutatorStack getMutatorStack()
getMutatorStack
in interface BuildLoggerWithoutLogAccess
public void close()
close
in interface BuildLoggerWithoutLogAccess
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.