#ifndef __CATEGORYLOGSINKBACKEND_H__
#define __CATEGORYLOGSINKBACKEND_H__

#include <boost/log/sinks.hpp>
#include <functional>
#include <string>

class CategoryLogSinkBackend
    : public boost::log::sinks::basic_formatted_sink_backend<char, boost::log::sinks::synchronized_feeding> {
public:
    using Append = std::function<void(const std::string &)>;
    CategoryLogSinkBackend(const std::string &category, Append &&append);
    void consume(const boost::log::record_view &record, string_type const &output);

private:
    std::string m_category;
    Append m_append;
};

#endif // __CATEGORYLOGSINKBACKEND_H__
