SmartLockerTools/Analyser/CategoryLogSinkBackend.cpp

14 lines
468 B
C++
Raw Permalink Normal View History

2024-05-21 21:09:55 +08:00
#include "CategoryLogSinkBackend.h"
2024-06-13 15:41:40 +08:00
#include "BoostLog.h"
2024-05-21 21:09:55 +08:00
2024-06-13 15:41:40 +08:00
CategoryLogSinkBackend::CategoryLogSinkBackend(const std::string &category, Append &&append)
: m_category(category), m_append(std::move(append)) {
2024-05-21 21:09:55 +08:00
}
void CategoryLogSinkBackend::consume(const boost::log::record_view &record, string_type const &output) {
auto &&category = record[AmassKeywords::category];
2024-06-13 15:41:40 +08:00
if ((category == m_category) && m_append) {
m_append(output);
2024-05-21 21:09:55 +08:00
}
}