com.atlassian.bamboo.build.logger
Interface BuildLogger

All Known Implementing Classes:
BuildLoggerImpl, NullBuildLogger, RemoteBuildLogger, SimpleBuildLogger

public interface BuildLogger

This interface represents a logger for a given build


Method Summary
 java.lang.String addBuildLogEntry(LogEntry logEntry)
          Add a new build log entry.
 java.lang.String addBuildLogEntry(java.lang.String logString)
          Create a new build log entry from text to append to logs
 java.lang.String addBuildLogHeader(java.lang.String logString, boolean showBothBanner)
           
 java.lang.String addErrorLogEntry(LogEntry logEntry)
          Add a new build error log entry.
 java.lang.String addErrorLogEntry(java.lang.String logString)
          Add a new build error log entry from text.
 void addErrorLogEntry(java.lang.String logString, java.lang.Throwable e)
          Adds an error log entry and each frame of the stack trace as a new error log entry
 void clearBuildLog()
          Reset the build log, ready for the next build
 void close()
           
 java.util.List<LogEntry> getBuildLog()
          Provide the latest build details (last 100 lines of logs).
 java.util.List<LogEntry> getErrorLog()
          Provide the latest error logs.
 LogInterceptorStack getInterceptorStack()
           
 java.util.List<LogEntry> getLastNLogEntries(int n)
          Provide the latest build details (last n lines of logs).
 java.util.List<java.lang.String> getStringErrorLogs()
           
 long getTimeOfLastLog()
          last time a log entry was added.
 void startStreamingBuildLogs(PlanResultKey planResultKey)
          Begin streaming any logs to build logs file
 void stopStreamingBuildLogs()
          Stop streaming any logs to the build logs file
 

Method Detail

getBuildLog

@NotNull
java.util.List<LogEntry> getBuildLog()
Provide the latest build details (last 100 lines of logs). This is not persisted.

Returns:
The list of LogEntrys.

getErrorLog

@NotNull
java.util.List<LogEntry> getErrorLog()
Provide the latest error logs. This is not persisted

Returns:
The list of LogEntrys.

getLastNLogEntries

@NotNull
java.util.List<LogEntry> getLastNLogEntries(int n)
Provide the latest build details (last n lines of logs). This is not persisted.

Returns:
The list of LogEntrys.

getStringErrorLogs

java.util.List<java.lang.String> getStringErrorLogs()

addBuildLogEntry

@NotNull
java.lang.String addBuildLogEntry(LogEntry logEntry)
Add a new build log entry. This will get appended to the end of the log.

Parameters:
logEntry - The data being logged
Returns:
The line of text being logged. From LogEntry.getUnstyledLog().

addBuildLogEntry

java.lang.String addBuildLogEntry(@NotNull
                                  java.lang.String logString)
Create a new build log entry from text to append to logs

Parameters:
logString - text to create log entry from
Returns:
The line of text being logged. From LogEntry.getUnstyledLog().

addBuildLogHeader

java.lang.String addBuildLogHeader(java.lang.String logString,
                                   boolean showBothBanner)

addErrorLogEntry

@NotNull
java.lang.String addErrorLogEntry(LogEntry logEntry)
Add a new build error log entry. This will get appended to the end of the log and to the end of the errors.

Parameters:
logEntry - The data being logged
Returns:
The line of text being logged. From LogEntry.getUnstyledLog().

addErrorLogEntry

java.lang.String addErrorLogEntry(java.lang.String logString)
Add 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.

Parameters:
logString - The text to create log entry from
Returns:
The line of text being logged. From LogEntry.getUnstyledLog().

addErrorLogEntry

void addErrorLogEntry(java.lang.String logString,
                      java.lang.Throwable e)
Adds an error log entry and each frame of the stack trace as a new error log entry

Parameters:
logString -
e -

startStreamingBuildLogs

void startStreamingBuildLogs(@NotNull
                             PlanResultKey planResultKey)
Begin streaming any logs to build logs file

Parameters:
planResultKey -

stopStreamingBuildLogs

void stopStreamingBuildLogs()
Stop streaming any logs to the build logs file


clearBuildLog

void clearBuildLog()
Reset the build log, ready for the next build


getTimeOfLastLog

long getTimeOfLastLog()
last time a log entry was added. If no logs, returns 0

Returns:

getInterceptorStack

@NotNull
LogInterceptorStack getInterceptorStack()
Returns:
stack of log interceptors attached to this build logger

close

void close()


Copyright © 2012 Atlassian. All Rights Reserved.