16 lines
590 B
C++
16 lines
590 B
C++
|
#include "CategoryLogSinkBackend.h"
|
||
|
#include "AsyncEvent.h"
|
||
|
#include <QTextBrowser>
|
||
|
#include <iostream>
|
||
|
|
||
|
CategoryLogSinkBackend::CategoryLogSinkBackend(const std::string &category, QTextBrowser *target)
|
||
|
: m_category(category), m_target(target) {
|
||
|
}
|
||
|
|
||
|
void CategoryLogSinkBackend::consume(const boost::log::record_view &record, string_type const &output) {
|
||
|
auto &&category = record[AmassKeywords::category];
|
||
|
if (category == m_category) {
|
||
|
Amass::executeAtObjectThread(m_target, [this, output]() { m_target->append(QString::fromStdString(output)); });
|
||
|
}
|
||
|
}
|