org.eclipse.osgi.framework.log
Interface FrameworkLog

All Known Implementing Classes:
EclipseLog

public interface FrameworkLog

The FramworkLog interface. A FrameworkLog implementation is provided by the FrameworkAdaptor and used by the Framework to log any error messages and FrameworkEvents of type ERROR. The FrameworkLog may persist the log messages to the filesystem or allow other ways of accessing the log information.

Since:
3.1

Field Summary
static java.lang.String SERVICE_PERFORMANCE
          A service lookup constant (value "performance") indicating an implementation of the logging service that logs performance events.
 
Method Summary
 void close()
          Closes the FrameworkLog.
 java.io.File getFile()
          Returns the log File if it is set, otherwise null is returned.
 void log(FrameworkEvent frameworkEvent)
          Logs the information from a FrameworkEvent to the FrameworkLog.
 void log(FrameworkLogEntry logEntry)
          Logs the FrameworkLogEntry to the FrameworkLog
 void setConsoleLog(boolean consoleLog)
          Sets the console log option.
 void setFile(java.io.File newFile, boolean append)
          Sets the current File used to log messages to a FileWriter using the specified File.
 void setWriter(java.io.Writer newWriter, boolean append)
          Sets the current Writer used to log messages to the specified newWriter.
 

Field Detail

SERVICE_PERFORMANCE

static final java.lang.String SERVICE_PERFORMANCE
A service lookup constant (value "performance") indicating an implementation of the logging service that logs performance events. Create a filter with this property set to "true" in order to obtain a performance log.

Since:
3.1
See Also:
Constant Field Values
Method Detail

log

void log(FrameworkEvent frameworkEvent)
Logs the information from a FrameworkEvent to the FrameworkLog.

Parameters:
frameworkEvent - The FrameworkEvent to log.

log

void log(FrameworkLogEntry logEntry)
Logs the FrameworkLogEntry to the FrameworkLog

Parameters:
logEntry - The entry to log.

setWriter

void setWriter(java.io.Writer newWriter,
               boolean append)
Sets the current Writer used to log messages to the specified newWriter. If append is set to true then the content of the current Writer will be appended to the new Writer if possible.

Parameters:
newWriter - The Writer to use for logging messages.
append - Indicates whether the content of the current Writer used for logging messages should be appended to the end of the new Writer.

setFile

void setFile(java.io.File newFile,
             boolean append)
             throws java.io.IOException
Sets the current File used to log messages to a FileWriter using the specified File. If append is set to true then the content of the current Writer will be appended to the new File if possible.

Parameters:
newFile - The File to create a new FileWriter which will be used for logging messages.
append - Indicates whether the content of the current Writer used for logging messages should be appended to the end of the new File.
Throws:
java.io.IOException - if any problem occurs while constructing a FileWriter from the newFile. If this exception is thrown the FrameworkLog will not be effected and will continue to use the current Writer to log messages.

getFile

java.io.File getFile()
Returns the log File if it is set, otherwise null is returned.

Returns:
the log File if it is set, otherwise null is returned.

setConsoleLog

void setConsoleLog(boolean consoleLog)
Sets the console log option. If this is set then all logs will be logged to System.out as well as the current Writer.

Parameters:
consoleLog - indicates whether to log to System.out

close

void close()
Closes the FrameworkLog. After the FrameworkLog is closed messages may no longer be logged to it.