com.atlassian.bamboo.build.logger
Class BuildLogFileWriter

java.lang.Object
  extended by com.atlassian.bamboo.build.logger.BuildLogFileWriter

@NotThreadSafe
public class BuildLogFileWriter
extends java.lang.Object

Class to encapsulate streaming of build logs. This is not thread safe The writer is opened on creation of the BuildLogFileWriter and a call to close() must be made when finished writing.


Constructor Summary
BuildLogFileWriter(int buildNum, java.lang.String planKey)
          Finds/Creates Log file for this build and establishes a write connection
 
Method Summary
 void close()
          Closes the writer to the log file.
 void writeLog(LogEntry logEntry)
          Writes one line of logs to the log file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildLogFileWriter

public BuildLogFileWriter(int buildNum,
                          @NotNull
                          java.lang.String planKey)
                   throws java.io.IOException
Finds/Creates Log file for this build and establishes a write connection

Parameters:
buildNum - number for the build
planKey - key of the build
Throws:
java.io.IOException - if errors accessing the file
Method Detail

writeLog

public void writeLog(@NotNull
                     LogEntry logEntry)
              throws java.io.IOException
Writes one line of logs to the log file

Parameters:
logEntry - to be written to file
Throws:
java.io.IOException - if errors accessing the file

close

public void close()
           throws java.io.IOException
Closes the writer to the log file. Must be called when writing complete

Throws:
java.io.IOException - if problems closing the file


Copyright © 2010 Atlassian. All Rights Reserved.