return createFrameworkLog(bundle, defaultWriter);
}
FrameworkLog createFrameworkLog(Bundle bundle, EclipseLogWriter eclipseWriter) {
final EclipseLogWriter logWriter = eclipseWriter == null ? defaultWriter : eclipseWriter;
final Logger logger = bundle == null ? logManager.getSystemBundleLog().getLogger(eclipseWriter.getLoggerName()) : logManager.getSystemBundleLog().getLogger(bundle, logWriter.getLoggerName());
return new FrameworkLog() {
public void setWriter(Writer newWriter, boolean append) {
logWriter.setWriter(newWriter, append);
}
public void setFile(File newFile, boolean append) throws IOException {
logWriter.setFile(newFile, append);
}
public void setConsoleLog(boolean consoleLog) {
logWriter.setConsoleLog(consoleLog);
}
public void log(FrameworkLogEntry logEntry) {
logger.log(logEntry, convertLevel(logEntry), logEntry.getMessage(), logEntry.getThrowable());
}
public void log(FrameworkEvent frameworkEvent) {
Bundle b = frameworkEvent.getBundle();
Throwable t = frameworkEvent.getThrowable();