Fix AuditLog parts selection

This commit is contained in:
Felipe Zimmerle 2016-01-21 15:03:47 -03:00
parent 9343942398
commit b9b3e82900
2 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ std::string Writer::file_name(const std::string& unique_id) {
*
*/
bool Writer::write(Transaction *transaction, int parts) {
std::cout << transaction->toJSON(0) << std::endl;
std::cout << transaction->toJSON(parts) << std::endl;
return true;
}

View File

@ -1193,6 +1193,7 @@ int Transaction::processLogging(int returned_code) {
#endif
std::list<std::pair<int, std::string>>::iterator it;
parts = this->m_rules->audit_log->m_parts;
debug(7, "AuditLog parts before modification(s): " + std::to_string(parts) + ".");
for (it = m_auditLogModifier.begin();
it != m_auditLogModifier.end(); ++it) {
std::pair <int, std::string> p = *it;
@ -1215,7 +1216,7 @@ int Transaction::processLogging(int returned_code) {
bool saved = this->m_rules->audit_log->saveIfRelevant(this, parts);
if (saved) {
#ifndef NO_LOGS
debug(8, "Request was relevant to be saved.");
debug(8, "Request was relevant to be saved. Parts: " + std::to_string(parts));
#endif
}
}
@ -1401,7 +1402,6 @@ std::string Transaction::toJSON(int parts) {
std::string ts = ascTime(&m_timeStamp).c_str();
std::string uniqueId = UniqueId::uniqueId();
parts = 0;
g = yajl_gen_alloc(NULL);
if (g == NULL) {
return "";