public void generateLog(ConfigGeneratorCallback callback) {
for (Object[] logPair : descriptorLogs.values()) {
try {
StringWriter logBuffer = (StringWriter) logPair[0];
PrintWriter log = (PrintWriter) logPair[1];
ConfigDescriptor descriptor = (ConfigDescriptor) logPair[2];
String logfile = generator.getDescriptorLogFile(descriptor);
callback.logEntry(descriptor, logfile);
String logContent = logBuffer.toString();
Writer writer = null;
try {
writer = new BufferedWriter(new OutputStreamWriter(currentOutputStream, LocaleInfo.getDefault()
.getCharset())) {
@Override
public void close() throws IOException {
// ����ر�
}
};
generator.logger.info("<" + descriptor.getBaseURL() + ">\n Generating log file: " + logfile
+ "\n");
writer.write(logContent);
} catch (IOException e) {
throw new ConfigException(e);