From 6ba888fb4477383ae61de2d5fd0d9e61bf45a6ec Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Sat, 15 Feb 2014 11:30:47 +0000 Subject: [PATCH] Improved logging. --- src/backend/metadata.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/backend/metadata.cpp b/src/backend/metadata.cpp index 8e79fe81..5c1af653 100644 --- a/src/backend/metadata.cpp +++ b/src/backend/metadata.cpp @@ -306,7 +306,7 @@ namespace boss { : name(n), enabled(true), priority(0) { // Get data from file contents using libespm. Assumes libespm has already been initialised. - BOOST_LOG_TRIVIAL(trace) << "Opening plugin with libespm..."; + BOOST_LOG_TRIVIAL(trace) << name << ": " << "Opening with libespm..."; boost::filesystem::path filepath = game.DataPath() / name; //In case the plugin is ghosted, but the extension already got trimmed. @@ -325,22 +325,22 @@ namespace boss { //If the name passed ends in '.ghost', that should be trimmed. if (boost::iends_with(name, ".ghost")) { - BOOST_LOG_TRIVIAL(trace) << "Trimming '.ghost' extension."; + BOOST_LOG_TRIVIAL(trace) << name << ": " << "Trimming '.ghost' extension."; name = name.substr(0, name.length() - 6); } - BOOST_LOG_TRIVIAL(trace) << "Checking to see if plugin is a master or not."; + BOOST_LOG_TRIVIAL(trace) << name << ": " << "Checking master flag."; isMaster = file->isMaster(game.espm_settings); - BOOST_LOG_TRIVIAL(trace) << "Getting the plugin's masters."; + BOOST_LOG_TRIVIAL(trace) << name << ": " << "Getting masters."; masters = file->getMasters(); - BOOST_LOG_TRIVIAL(trace) << "Number of masters: " << masters.size(); + BOOST_LOG_TRIVIAL(trace) << name << ": " << "Number of masters: " << masters.size(); crc = file->crc; game.crcCache.insert(pair(n, crc)); - BOOST_LOG_TRIVIAL(trace) << "Getting the plugin's FormIDs."; + BOOST_LOG_TRIVIAL(trace) << name << ": " << "Getting the FormIDs."; vector records = file->getFormIDs(); vector plugins = masters; plugins.push_back(name); @@ -352,7 +352,7 @@ namespace boss { } //Also read Bash Tags applied and version string in description. - BOOST_LOG_TRIVIAL(trace) << "Reading the plugin description."; + BOOST_LOG_TRIVIAL(trace) << name << ": " << "Reading the description."; string text = file->getDescription(); delete file; @@ -361,7 +361,7 @@ namespace boss { begin = text.begin(); end = text.end(); - BOOST_LOG_TRIVIAL(trace) << "Attempting to read the plugin version from its description."; + BOOST_LOG_TRIVIAL(trace) << name << ": " << "Attempting to read the version from the description."; for(int j = 0; j < 7 && version.empty(); j++) { boost::smatch what; while (boost::regex_search(begin, end, what, version_checks[j])) { @@ -377,7 +377,7 @@ namespace boss { } } - BOOST_LOG_TRIVIAL(trace) << "Attempting to extract Bash Tags from the description."; + BOOST_LOG_TRIVIAL(trace) << name << ": " << "Attempting to extract Bash Tags from the description."; size_t pos1 = text.find("{{BASH:"); if (pos1 == string::npos || pos1 + 7 == text.length()) return; @@ -395,7 +395,7 @@ namespace boss { for (int i=0,max=bashTags.size(); i