diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-30 19:03:17 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-30 19:03:17 +0100 |
commit | b4e0ad1ef24fd49bcd5cdd1b6f1dd69768036e07 (patch) | |
tree | 39d7ce4ab5193fc31e3420ed5c52c9b42b4ddc22 /lib/Utils | |
parent | 70e0330d6919b3e7e372e5cdd04282a51fe64788 (diff) | |
download | abrt-b4e0ad1ef24fd49bcd5cdd1b6f1dd69768036e07.tar.gz abrt-b4e0ad1ef24fd49bcd5cdd1b6f1dd69768036e07.tar.xz abrt-b4e0ad1ef24fd49bcd5cdd1b6f1dd69768036e07.zip |
move logger's report text creation to lib/Utils/make_descr.cpp
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Utils')
-rw-r--r-- | lib/Utils/Plugin.h | 1 | ||||
-rw-r--r-- | lib/Utils/make_descr.cpp | 65 |
2 files changed, 66 insertions, 0 deletions
diff --git a/lib/Utils/Plugin.h b/lib/Utils/Plugin.h index eabfa10d..00c7e5be 100644 --- a/lib/Utils/Plugin.h +++ b/lib/Utils/Plugin.h @@ -116,5 +116,6 @@ typedef struct SPluginInfo /* helper finctions */ std::string make_description_bz(const map_crash_report_t& pCrashReport); +std::string make_description_logger(const map_crash_report_t& pCrashReport); #endif diff --git a/lib/Utils/make_descr.cpp b/lib/Utils/make_descr.cpp index 8f1c8617..2823dbb4 100644 --- a/lib/Utils/make_descr.cpp +++ b/lib/Utils/make_descr.cpp @@ -85,3 +85,68 @@ string make_description_bz(const map_crash_report_t& pCrashReport) return description; } + +string make_description_logger(const map_crash_report_t& pCrashReport) +{ +// string description; + stringstream binaryFiles, commonFiles, bigTextFiles, additionalFiles, UUIDFile; + + map_crash_report_t::const_iterator it = pCrashReport.begin(); + for (; it != pCrashReport.end(); it++) + { + if (it->second[CD_TYPE] == CD_TXT) + { + if (it->first != CD_UUID + && it->first != FILENAME_ARCHITECTURE + && it->first != FILENAME_KERNEL + && it->first != FILENAME_PACKAGE + ) { + additionalFiles << it->first << std::endl; + additionalFiles << "-----" << std::endl; + additionalFiles << it->second[CD_CONTENT] << std::endl << std::endl; + } + else if (it->first == CD_UUID) + { + UUIDFile << it->first << std::endl; + UUIDFile << "-----" << std::endl; + UUIDFile << it->second[CD_CONTENT] << std::endl << std::endl; + } + else + { + commonFiles << it->first << std::endl; + commonFiles << "-----" << std::endl; + commonFiles << it->second[CD_CONTENT] << std::endl << std::endl; + } + } + if (it->second[CD_TYPE] == CD_ATT) + { + bigTextFiles << it->first << std::endl; + bigTextFiles << "-----" << std::endl; + bigTextFiles << it->second[CD_CONTENT] << std::endl << std::endl; + } + if (it->second[CD_TYPE] == CD_BIN) + { + binaryFiles << it->first << std::endl; + binaryFiles << "-----" << std::endl; + binaryFiles << it->second[CD_CONTENT] << std::endl << std::endl; + } + } + + string description = "Duplicity check\n======\n\n"; + description += UUIDFile.str(); + description += '\n'; + description += "Common information\n======\n\n"; + description += commonFiles.str(); + description += '\n'; + description += "Additional information\n======\n\n"; + description += additionalFiles.str(); + description += '\n'; + description += "Big Text Files\n======\n\n"; + description += bigTextFiles.str(); + description += '\n'; + description += "Binary files\n======\n"; + description += binaryFiles.str(); + description += "\n\n"; + + return description; +} |