Class BuildLoggerImpl
- java.lang.Object
-
- com.atlassian.bamboo.build.logger.AbstractBuildLogger
-
- com.atlassian.bamboo.build.logger.BuildLoggerImpl
-
- All Implemented Interfaces:
BuildLogger,BuildLoggerWithoutLogAccess,FileWritingBuildLogger
public class BuildLoggerImpl extends AbstractBuildLogger implements FileWritingBuildLogger
-
-
Field Summary
Fields Modifier and Type Field Description protected ExpiryTickerexpiryTicker-
Fields inherited from class com.atlassian.bamboo.build.logger.AbstractBuildLogger
MAX_BUILDLOG_SIZE
-
-
Constructor Summary
Constructors Constructor Description BuildLoggerImpl(LoggerId<? extends Key> loggerId, @NotNull ExpiryTicker expiryTicker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull StringaddBuildLogEntry(@NotNull LogEntry entry)Add a new build log entry.@NotNull StringaddErrorLogEntry(@NotNull LogEntry entry)Add a new build error log entry.StringaddRemoteBuildLogEntry(@NotNull LogEntry entry, boolean needToPersistOnTarget, boolean addedAfterLogSpoolClosed)StringaddRemoteErrorLogEntry(@NotNull LogEntry entry, boolean needToPersistOnTarget, boolean addedAfterLogSpoolClosed)voidflush()voidhandleRemoteLogFile(@NotNull File logFile, @NotNull File remoteLogFile)Replace underlying log file with the remote log.booleanisPersistent()voidonAddLogEntry(@NotNull LogEntry logEntry)voidstopStreamingBuildLogs()Stop streaming any logs to the build logs filevoidswitchPersistence(boolean persistent)-
Methods inherited from class com.atlassian.bamboo.build.logger.AbstractBuildLogger
addBuildLogEntry, addErrorLogEntry, addErrorLogEntry, addErrorLogEntryInternal, addLogEntry, close, getBuildLog, getErrorLog, getInterceptorStack, getLastNLogEntries, getLogEntryCount, getMutatorStack, getTimeOfLastLog, interceptAndMutate, interceptAndMutateError, setTimeOfLastLog
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.build.logger.BuildLogger
getLastNLogEntries, getLogEntryCount
-
Methods inherited from interface com.atlassian.bamboo.build.logger.BuildLoggerWithoutLogAccess
addBuildLogEntry, addErrorLogEntry, addErrorLogEntry, close, getInterceptorStack, getMutatorStack, getTimeOfLastLog, setTimeOfLastLog, transfersLogsAsArtifact
-
-
-
-
Field Detail
-
expiryTicker
protected final ExpiryTicker expiryTicker
-
-
Constructor Detail
-
BuildLoggerImpl
public BuildLoggerImpl(LoggerId<? extends Key> loggerId, @NotNull @NotNull ExpiryTicker expiryTicker)
-
-
Method Detail
-
addRemoteBuildLogEntry
public String addRemoteBuildLogEntry(@NotNull @NotNull LogEntry entry, boolean needToPersistOnTarget, boolean addedAfterLogSpoolClosed)
- Specified by:
addRemoteBuildLogEntryin interfaceFileWritingBuildLogger
-
addRemoteErrorLogEntry
public String addRemoteErrorLogEntry(@NotNull @NotNull LogEntry entry, boolean needToPersistOnTarget, boolean addedAfterLogSpoolClosed)
- Specified by:
addRemoteErrorLogEntryin interfaceFileWritingBuildLogger
-
addBuildLogEntry
@NotNull public @NotNull String addBuildLogEntry(@NotNull @NotNull LogEntry entry)
Description copied from interface:BuildLoggerWithoutLogAccessAdd a new build log entry. This will get appended to the end of the log.- Specified by:
addBuildLogEntryin interfaceBuildLoggerWithoutLogAccess- Overrides:
addBuildLogEntryin classAbstractBuildLogger- Parameters:
entry- The data being logged- Returns:
- The line of text being logged. From
LogEntry.getUnstyledLog().
-
addErrorLogEntry
@NotNull public @NotNull String addErrorLogEntry(@NotNull @NotNull LogEntry entry)
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- Overrides:
addErrorLogEntryin classAbstractBuildLogger- Parameters:
entry- The data being logged- Returns:
- The line of text being logged. From
LogEntry.getUnstyledLog().
-
switchPersistence
public void switchPersistence(boolean persistent)
-
onAddLogEntry
public void onAddLogEntry(@NotNull @NotNull LogEntry logEntry)- Specified by:
onAddLogEntryin classAbstractBuildLogger
-
stopStreamingBuildLogs
public void stopStreamingBuildLogs()
Description copied from interface:BuildLoggerWithoutLogAccessStop streaming any logs to the build logs file- Specified by:
stopStreamingBuildLogsin interfaceBuildLoggerWithoutLogAccess- Specified by:
stopStreamingBuildLogsin classAbstractBuildLogger
-
flush
public void flush()
-
isPersistent
public boolean isPersistent()
- Specified by:
isPersistentin interfaceBuildLoggerWithoutLogAccess- Returns:
- true if underlying logger saves to disk
-
handleRemoteLogFile
public void handleRemoteLogFile(@NotNull @NotNull File logFile, @NotNull @NotNull File remoteLogFile) throws IOExceptionDescription copied from interface:FileWritingBuildLoggerReplace underlying log file with the remote log. If not possible, then append. Stop accepting live logs from remote agent.- Specified by:
handleRemoteLogFilein interfaceFileWritingBuildLogger- Throws:
IOException
-
-