Class AbstractBuildLogger
java.lang.Object
com.atlassian.bamboo.build.logger.AbstractBuildLogger
- All Implemented Interfaces:
BuildLogger,BuildLoggerWithoutLogAccess
- Direct Known Subclasses:
BuildLoggerImpl,RemoteBuildLogger
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull StringaddBuildLogEntry(@NotNull LogEntry logEntry) Add a new build log entry.@NotNull StringaddBuildLogEntry(@NotNull String logString) Create a new build log entry from text to append to logs@NotNull StringaddErrorLogEntry(@NotNull LogEntry logEntry) Add a new build error log entry.@NotNull StringaddErrorLogEntry(String logString) Add a new build error log entry from text.voidaddErrorLogEntry(String logString, @Nullable Throwable e) Adds an error log entry and each frame of the stack trace as a new error log entryprotected StringaddErrorLogEntryInternal(@NotNull LogEntry logEntry) protected @NotNull StringaddLogEntry(@NotNull LogEntry logEntry) voidclose()@NotNull LogInterceptorStackgetLastNLogEntries(int n) Provide the latest build details (last n lines of logs).intTotal number of log entries.@NotNull LogMutatorStacklonglast time a log entry was added.protected @NotNull LogEntryinterceptAndMutate(@NotNull LogEntry logEntry) protected @NotNull LogEntryinterceptAndMutateError(@NotNull LogEntry logEntry) abstract voidonAddLogEntry(@NotNull LogEntry logEntry) voidsetTimeOfLastLog(long timeOfLastLog) set time of last log.abstract voidStop streaming any logs to the build logs fileMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.build.logger.BuildLoggerWithoutLogAccess
isPersistent, transfersLogsAsArtifact
-
Field Details
-
MAX_BUILDLOG_SIZE
protected static final int MAX_BUILDLOG_SIZE- See Also:
-
-
Constructor Details
-
AbstractBuildLogger
-
-
Method Details
-
onAddLogEntry
-
stopStreamingBuildLogs
public abstract void stopStreamingBuildLogs()Description copied from interface:BuildLoggerWithoutLogAccessStop streaming any logs to the build logs file- Specified by:
stopStreamingBuildLogsin interfaceBuildLoggerWithoutLogAccess
-
getBuildLog
-
getErrorLog
-
getLogEntryCount
public int getLogEntryCount()Description copied from interface:BuildLoggerTotal number of log entries.- Specified by:
getLogEntryCountin interfaceBuildLogger
-
getLastNLogEntries
Description copied from interface:BuildLoggerProvide the latest build details (last n lines of logs). This is not persisted.- Specified by:
getLastNLogEntriesin interfaceBuildLogger- Returns:
- The list of
LogEntrys.
-
addBuildLogEntry
Description copied from interface:BuildLoggerWithoutLogAccessAdd a new build log entry. This will get appended to the end of the log.- Specified by:
addBuildLogEntryin interfaceBuildLoggerWithoutLogAccess- Parameters:
logEntry- The data being logged- Returns:
- The line of text being logged. From
LogEntry.getUnstyledLog().
-
addErrorLogEntry
Description copied from interface:BuildLoggerWithoutLogAccessAdd a new build error log entry. This will get appended to the end of the log and to the end of the errors.- Specified by:
addErrorLogEntryin interfaceBuildLoggerWithoutLogAccess- Parameters:
logEntry- The data being logged- Returns:
- The line of text being logged. From
LogEntry.getUnstyledLog().
-
addErrorLogEntryInternal
-
interceptAndMutate
-
interceptAndMutateError
-
addLogEntry
-
addBuildLogEntry
Description copied from interface:BuildLoggerWithoutLogAccessCreate a new build log entry from text to append to logs- Specified by:
addBuildLogEntryin interfaceBuildLoggerWithoutLogAccess- Parameters:
logString- text to create log entry from- Returns:
- The line of text being logged. From
LogEntry.getUnstyledLog().
-
addErrorLogEntry
Description copied from interface:BuildLoggerWithoutLogAccessAdd a new build error log entry from text. This will get appended to the end of the log and to the end of the errors.- Specified by:
addErrorLogEntryin interfaceBuildLoggerWithoutLogAccess- Parameters:
logString- The text to create log entry from- Returns:
- The line of text being logged. From
LogEntry.getUnstyledLog().
-
addErrorLogEntry
Description copied from interface:BuildLoggerWithoutLogAccessAdds an error log entry and each frame of the stack trace as a new error log entry- Specified by:
addErrorLogEntryin interfaceBuildLoggerWithoutLogAccess- Parameters:
logString-e-
-
getTimeOfLastLog
public long getTimeOfLastLog()Description copied from interface:BuildLoggerWithoutLogAccesslast time a log entry was added. If no logs, returns 0- Specified by:
getTimeOfLastLogin interfaceBuildLoggerWithoutLogAccess- Returns:
-
setTimeOfLastLog
public void setTimeOfLastLog(long timeOfLastLog) Description copied from interface:BuildLoggerWithoutLogAccessset time of last log. Used for loading buildings in progress after restarts- Specified by:
setTimeOfLastLogin interfaceBuildLoggerWithoutLogAccess
-
getInterceptorStack
- Specified by:
getInterceptorStackin interfaceBuildLoggerWithoutLogAccess- Returns:
- stack of log interceptors attached to this build logger
-
getMutatorStack
- Specified by:
getMutatorStackin interfaceBuildLoggerWithoutLogAccess- Returns:
- stack of log mutators attached to this build logger
-
close
public void close()- Specified by:
closein interfaceBuildLoggerWithoutLogAccess
-