com.atlassian.bamboo.build.logger
Class BuildLogFileWriter

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

public class BuildLogFileWriter
extends Object
implements Closeable, Flushable

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, String planKey)
          Deprecated. since 5.0
BuildLogFileWriter(LoggerId loggerId, ExpiryTicker expiryTicker)
           
 
Method Summary
 void close()
          Closes the writer to the log file.
 void flush()
           
 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
                                     String planKey)
                   throws IOException
Deprecated. since 5.0

Finds/Creates Log file for this build and establishes a write connection

Parameters:
buildNum - number for the build
planKey - key of the build
Throws:
IOException - if errors accessing the file

BuildLogFileWriter

public BuildLogFileWriter(@NotNull
                          LoggerId loggerId,
                          @NotNull
                          ExpiryTicker expiryTicker)
                   throws IOException
Throws:
IOException
Method Detail

writeLog

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

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

close

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

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

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Throws:
IOException


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.