com.atlassian.bamboo.build.logger
Class BuildLogFileWriter

java.lang.Object
  extended by com.atlassian.bamboo.build.logger.BuildLogFileWriter
All Implemented Interfaces:
java.io.Closeable

public class BuildLogFileWriter
extends java.lang.Object
implements java.io.Closeable

Class to encapsulate streaming of build logs. 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)
          Deprecated. 
BuildLogFileWriter(LoggerId loggerId, ExpiryTicker expiryTicker)
           
 
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

@Deprecated
public BuildLogFileWriter(int buildNum,
                                     @NotNull
                                     java.lang.String planKey)
                   throws java.io.IOException
Deprecated. 

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

BuildLogFileWriter

public BuildLogFileWriter(@NotNull
                          LoggerId loggerId,
                          @NotNull
                          ExpiryTicker expiryTicker)
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

Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException - if problems closing the file


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