SmartLockerTools/Analyser/CategoryLogSinkBackend.h

21 lines
595 B
C++

#ifndef __CATEGORYLOGSINKBACKEND_H__
#define __CATEGORYLOGSINKBACKEND_H__
#include <boost/log/sinks.hpp>
#include <string>
class QTextBrowser;
class CategoryLogSinkBackend
: public boost::log::sinks::basic_formatted_sink_backend<char, boost::log::sinks::synchronized_feeding> {
public:
CategoryLogSinkBackend(const std::string &category, QTextBrowser *target);
void consume(const boost::log::record_view &record, string_type const &output);
private:
std::string m_category;
QTextBrowser *m_target = nullptr;
};
#endif // __CATEGORYLOGSINKBACKEND_H__