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
Fields inherited from class com.atlassian.bamboo.build.logger.AbstractBuildLogger
MAX_BUILDLOG_SIZE
-
Constructor Summary
ConstructorDescriptionBuildLoggerImpl
(LoggerId<? extends Key> loggerId, @NotNull ExpiryTicker expiryTicker) -
Method Summary
Modifier and TypeMethodDescription@NotNull String
addBuildLogEntry
(@NotNull LogEntry entry) Add a new build log entry.@NotNull String
addErrorLogEntry
(@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) void
flush()
void
handleRemoteLogFile
(@NotNull File logFile, @NotNull File remoteLogFile) Replace underlying log file with the remote log.boolean
void
onAddLogEntry
(@NotNull LogEntry logEntry) void
Stop streaming any logs to the build logs filevoid
switchPersistence
(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 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:
addRemoteBuildLogEntry
in interfaceFileWritingBuildLogger
-
addRemoteErrorLogEntry
public String addRemoteErrorLogEntry(@NotNull @NotNull LogEntry entry, boolean needToPersistOnTarget, boolean addedAfterLogSpoolClosed) - Specified by:
addRemoteErrorLogEntry
in interfaceFileWritingBuildLogger
-
addBuildLogEntry
Description copied from interface:BuildLoggerWithoutLogAccess
Add a new build log entry. This will get appended to the end of the log.- Specified by:
addBuildLogEntry
in interfaceBuildLoggerWithoutLogAccess
- Overrides:
addBuildLogEntry
in classAbstractBuildLogger
- Parameters:
entry
- The data being logged- Returns:
- The line of text being logged. From
LogEntry.getUnstyledLog()
.
-
addErrorLogEntry
Description copied from interface:BuildLoggerWithoutLogAccess
Add 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:
addErrorLogEntry
in interfaceBuildLoggerWithoutLogAccess
- Overrides:
addErrorLogEntry
in 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:
onAddLogEntry
in classAbstractBuildLogger
-
stopStreamingBuildLogs
public void stopStreamingBuildLogs()Description copied from interface:BuildLoggerWithoutLogAccess
Stop streaming any logs to the build logs file- Specified by:
stopStreamingBuildLogs
in interfaceBuildLoggerWithoutLogAccess
- Specified by:
stopStreamingBuildLogs
in classAbstractBuildLogger
-
flush
public void flush() -
isPersistent
public boolean isPersistent()- Specified by:
isPersistent
in 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:FileWritingBuildLogger
Replace underlying log file with the remote log. If not possible, then append. Stop accepting live logs from remote agent.- Specified by:
handleRemoteLogFile
in interfaceFileWritingBuildLogger
- Throws:
IOException
-