diff options
Diffstat (limited to 'src/configuration.cpp')
-rw-r--r-- | src/configuration.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/configuration.cpp b/src/configuration.cpp index 4085b20b..9c3ff008 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -79,6 +79,8 @@ void Configuration::write() // Do not attempt to write to file that cannot be opened for writing FILE *testFile = fopen(mConfigPath.c_str(), "w"); if (!testFile) { + logger->log("Configuration::write() couldn't open %s for writing", + mConfigPath.c_str()); return; } else { @@ -89,15 +91,14 @@ void Configuration::write() if (writer) { + logger->log("Configuration::write() writing configuration..."); + xmlTextWriterSetIndent(writer, 1); xmlTextWriterStartDocument(writer, NULL, NULL, NULL); xmlTextWriterStartElement(writer, BAD_CAST "configuration"); for (OptionIterator i = mOptions.begin(); i != mOptions.end(); i++) { - logger->log("Configuration::write(%s, \"%s\")", - i->first.c_str(), i->second.c_str()); - xmlTextWriterStartElement(writer, BAD_CAST "option"); xmlTextWriterWriteAttribute(writer, BAD_CAST "name", BAD_CAST i->first.c_str()); @@ -109,6 +110,10 @@ void Configuration::write() xmlTextWriterEndDocument(writer); xmlFreeTextWriter(writer); } + else + { + logger->log("Configuration::write() error while creating writer"); + } } void Configuration::setValue(const std::string &key, std::string value) |