Log: Coloring logging output

Hello,
I try to create a formatter that can display logging messages (or just prints the severity level in different colors).
Given a format string like:
default_formatter = "%SeverityFormat% %Message%";
/// A custom formatter that handles the Severity formatting
class severity_formatter_factory :
public boost::log::formatter_factory<char>
{
public:
formatter_type create_formatter(boost::log::attribute_name const& name, args_map const& args)
{
namespace expr = boost::log::expressions;
return expr::stream <<
"|" << "\033[32m" << expr::attr
participants (1)
-
Florian Lindner