uiLogger = new TreeItemLogger();
AbstractTreeLogger bestLogger = uiLogger;
if (logFile != null) {
try {
PrintWriterTreeLogger fileLogger = new PrintWriterTreeLogger(logFile);
bestLogger = new CompositeTreeLogger(uiLogger, fileLogger);
fileLogger.setMaxDetail(logLevel);
uiLogger.setMaxDetail(logLevel);
} catch (IOException ex) {
uiLogger.log(TreeLogger.ERROR, "Can't log to " +
logFile.getAbsolutePath(), ex);