| | |
| | | #include "EventRegistry.h" |
| | | #include <cstddef> |
| | | #include <string.h> |
| | | #include <algorithm> |
| | | |
| | | namespace license { |
| | | EventRegistry::EventRegistry() { |
| | |
| | | logs.push_back(audit); |
| | | } |
| | | |
| | | bool EventRegistry::turnErrosIntoWarnings() { |
| | | bool eventFound = false; |
| | | for (auto it = logs.begin(); it != logs.end(); ++it) { |
| | | if (it->severity == SEVERITY_ERROR) { |
| | | it->severity = SEVERITY_WARN; |
| | | eventFound = true; |
| | | } |
| | | } |
| | | return eventFound; |
| | | } |
| | | |
| | | void EventRegistry::exportLastEvents(AuditEvent* auditEvents, int nlogs) { |
| | | int sizeToCopy = std::min(nlogs, (int) logs.size()); |
| | | std::copy(logs.begin(), logs.begin() + sizeToCopy, auditEvents); |
| | | } |
| | | } |
| | | |