com.atlassian.bamboo.build.logger
Class BuildLoggerImpl

java.lang.Object
  extended by com.atlassian.bamboo.build.logger.BuildLoggerImpl
All Implemented Interfaces:
BuildLogger
Direct Known Subclasses:
RemoteBuildLogger

public class BuildLoggerImpl
extends java.lang.Object
implements BuildLogger


Constructor Summary
BuildLoggerImpl(LoggerId loggerId, ExpiryTicker expiryTicker)
           
 
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)
          Deprecated. 
 void stopStreamingBuildLogs()
          Stop streaming any logs to the build logs file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildLoggerImpl

public BuildLoggerImpl(LoggerId loggerId,
                       @NotNull
                       ExpiryTicker expiryTicker)
Method Detail

getBuildLog

@NotNull
public java.util.List<LogEntry> getBuildLog()
Description copied from interface: BuildLogger
Provide the latest build details (last 100 lines of logs). This is not persisted.

Specified by:
getBuildLog in interface BuildLogger
Returns:
The list of LogEntrys.

getErrorLog

@NotNull
public java.util.List<LogEntry> getErrorLog()
Description copied from interface: BuildLogger
Provide the latest error logs. This is not persisted

Specified by:
getErrorLog in interface BuildLogger
Returns:
The list of LogEntrys.

getLastNLogEntries

@NotNull
public java.util.List<LogEntry> getLastNLogEntries(int n)
Description copied from interface: BuildLogger
Provide the latest build details (last n lines of logs). This is not persisted.

Specified by:
getLastNLogEntries in interface BuildLogger
Returns:
The list of LogEntrys.

getStringErrorLogs

@NotNull
public java.util.List<java.lang.String> getStringErrorLogs()
Specified by:
getStringErrorLogs in interface BuildLogger

addBuildLogEntry

@NotNull
public java.lang.String addBuildLogEntry(@NotNull
                                                 LogEntry logEntry)
Description copied from interface: BuildLogger
Add a new build log entry. This will get appended to the end of the log.

Specified by:
addBuildLogEntry in interface BuildLogger
Parameters:
logEntry - The data being logged
Returns:
The line of text being logged. From LogEntry.getUnstyledLog().

addErrorLogEntry

@NotNull
public java.lang.String addErrorLogEntry(@NotNull
                                                 LogEntry logEntry)
Description copied from interface: BuildLogger
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 interface BuildLogger
Parameters:
logEntry - The data being logged
Returns:
The line of text being logged. From LogEntry.getUnstyledLog().

addBuildLogEntry

@NotNull
public java.lang.String addBuildLogEntry(@NotNull
                                                 java.lang.String logString)
Description copied from interface: BuildLogger
Create a new build log entry from text to append to logs

Specified by:
addBuildLogEntry in interface BuildLogger
Parameters:
logString - text to create log entry from
Returns:
The line of text being logged. From LogEntry.getUnstyledLog().

addErrorLogEntry

@NotNull
public java.lang.String addErrorLogEntry(java.lang.String logString)
Description copied from interface: BuildLogger
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.

Specified by:
addErrorLogEntry in interface BuildLogger
Parameters:
logString - The text to create log entry from
Returns:
The line of text being logged. From LogEntry.getUnstyledLog().

addErrorLogEntry

public void addErrorLogEntry(java.lang.String logString,
                             @Nullable
                             java.lang.Throwable e)
Description copied from interface: BuildLogger
Adds an error log entry and each frame of the stack trace as a new error log entry

Specified by:
addErrorLogEntry in interface BuildLogger

addBuildLogHeader

@NotNull
public java.lang.String addBuildLogHeader(java.lang.String logString,
                                                  boolean showBothBanner)
Specified by:
addBuildLogHeader in interface BuildLogger

clearBuildLog

public void clearBuildLog()
Description copied from interface: BuildLogger
Reset the build log, ready for the next build

Specified by:
clearBuildLog in interface BuildLogger

startStreamingBuildLogs

@Deprecated
public void startStreamingBuildLogs(@NotNull
                                               PlanResultKey planResultKey)
Deprecated. 

Specified by:
startStreamingBuildLogs in interface BuildLogger

stopStreamingBuildLogs

public void stopStreamingBuildLogs()
Description copied from interface: BuildLogger
Stop streaming any logs to the build logs file

Specified by:
stopStreamingBuildLogs in interface BuildLogger

getTimeOfLastLog

public long getTimeOfLastLog()
Description copied from interface: BuildLogger
last time a log entry was added. If no logs, returns 0

Specified by:
getTimeOfLastLog in interface BuildLogger
Returns:

getInterceptorStack

@NotNull
public LogInterceptorStack getInterceptorStack()
Specified by:
getInterceptorStack in interface BuildLogger
Returns:
stack of log interceptors attached to this build logger

close

public void close()
Specified by:
close in interface BuildLogger


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.