if (log != null && log.isDebugEnabled()) {
log.debug(String.format("Writing change log to %s using character encoding %s", outputFile, encoding));
}
final Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), encoding));
try {
TemplateRuntime.execute(compiledTemplate, this, new MapVariableResolverFactory(variables), null /* no TemplateRegistry */, new TemplateOutputWriter(writer));
} finally {
try {
writer.flush();
} catch (final IOException ignore) {
// ignore on purpose