diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-25 21:36:37 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-07-25 21:36:37 +0000 |
commit | e6d8d2dd8eff63c23f0ffad25c5e2529bde93485 (patch) | |
tree | cce9c591350ce1d29c67df3339c526b182e8763e /src/configuration.cpp | |
parent | 33e19fb0822308a630ca6e1122b9b97882a120a7 (diff) | |
download | mana-e6d8d2dd8eff63c23f0ffad25c5e2529bde93485.tar.gz mana-e6d8d2dd8eff63c23f0ffad25c5e2529bde93485.tar.bz2 mana-e6d8d2dd8eff63c23f0ffad25c5e2529bde93485.tar.xz mana-e6d8d2dd8eff63c23f0ffad25c5e2529bde93485.zip |
Added support for writing log to standard output.
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) |