Writes audit log in parallel mode

First version still missing the index among other things
This commit is contained in:
Felipe Zimmerle
2015-07-10 15:23:15 -03:00
parent 693238b235
commit c9620ac50f
13 changed files with 164 additions and 30 deletions

View File

@@ -102,11 +102,11 @@ bool AuditLog::setType(AuditLogType audit_type) {
bool AuditLog::init() {
if (m_type == ParallelAuditLogType) {
m_writer = new AuditLogWriterParallel();
m_writer = new AuditLogWriterParallel(this);
}
if (m_type == SerialAuditLogType) {
m_writer = new AuditLogWriterSerial();
m_writer = new AuditLogWriterSerial(this);
}
if (m_writer == NULL || m_writer->init() == false) {
@@ -134,7 +134,7 @@ bool AuditLog::isRelevant(int status) {
bool AuditLog::saveIfRelevant(Assay *assay) {
if (this->isRelevant(assay->http_code_returned) == false &&
if (this->isRelevant(assay->httpCodeReturned) == false &&
assay->save_in_auditlog == false) {
return true;
}
@@ -148,9 +148,7 @@ bool AuditLog::saveIfRelevant(Assay *assay) {
return true;
}
std::string log = assay->to_json(0);
m_writer->write(log);
m_writer->write(assay);
return true;
}