Class BuildLoggerImpl
java.lang.Object
com.atlassian.bamboo.build.logger.AbstractBuildLogger
com.atlassian.bamboo.build.logger.BuildLoggerImpl
- All Implemented Interfaces:
BuildLogger,BuildLoggerWithoutLogAccess,FileWritingBuildLogger
-
Field Summary
FieldsFields inherited from class com.atlassian.bamboo.build.logger.AbstractBuildLogger
MAX_BUILDLOG_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionBuildLoggerImpl(LoggerId<? extends Key> loggerId, @NotNull ExpiryTicker expiryTicker) -
Method Summary
Modifier and TypeMethodDescription@NotNull StringaddBuildLogEntry(@NotNull LogEntry entry) Add a new build log entry.@NotNull StringaddErrorLogEntry(@NotNull LogEntry entry) Add a new build error log entry.addRemoteBuildLogEntry(@NotNull LogEntry entry, boolean needToPersistOnTarget, boolean addedAfterLogSpoolClosed) addRemoteErrorLogEntry(@NotNull LogEntry entry, boolean needToPersistOnTarget, boolean addedAfterLogSpoolClosed) voidflush()voidhandleRemoteLogFile(@NotNull File logFile, @NotNull File remoteLogFile) Replace underlying log file with the remote log.booleanvoidonAddLogEntry(@NotNull LogEntry logEntry) voidStop 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, setTimeOfLastLogMethods 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.BuildLogger
getLastNLogEntries, getLogEntryCountMethods inherited from interface com.atlassian.bamboo.build.logger.BuildLoggerWithoutLogAccess
addBuildLogEntry, addErrorLogEntry, addErrorLogEntry, close, getInterceptorStack, getMutatorStack, getTimeOfLastLog, setTimeOfLastLog, transfersLogsAsArtifact
-
Field Details
-
expiryTicker
-
-
Constructor Details
-
BuildLoggerImpl
public BuildLoggerImpl(LoggerId<? extends Key> loggerId, @NotNull @NotNull ExpiryTicker expiryTicker)
-
-
Method Details
-
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
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
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
- 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 IOException Description 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
-