Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
console_appender.hpp
Go to the documentation of this file.
1#pragma once
2#include <fc/log/appender.hpp>
3#include <fc/log/logger.hpp>
4#include <vector>
5
6namespace fc
7{
8 class console_appender final : public appender
9 {
10 public:
24
25 struct stream { enum type { std_out, std_error }; };
26
36
37 struct config
38 {
40 :format( "${timestamp} ${thread_name} ${context} ${file}:${line} ${method} ${level}] ${message}" ),
41 stream(console_appender::stream::std_error),flush(true){}
42
45 std::vector<level_color> level_colors;
46 bool flush;
47 };
48
49
50 console_appender( const variant& args );
51 console_appender( const config& cfg );
53
55 void initialize( boost::asio::io_service& io_service ) {}
56 virtual void log( const log_message& m );
57
58 void print( const std::string& text_to_print,
60
61 void configure( const config& cfg );
62
63 private:
64 class impl;
65 std::unique_ptr<impl> my;
66 };
67} // namespace fc
68
71FC_REFLECT_ENUM( fc::console_appender::color::type, (red)(green)(brown)(blue)(magenta)(cyan)(white)(console_default) )
73FC_REFLECT( fc::console_appender::config, (format)(stream)(level_colors)(flush) )
virtual void log(const log_message &m)
void print(const std::string &text_to_print, color::type text_color=color::console_default)
void configure(const config &cfg)
void initialize(boost::asio::io_service &io_service)
aggregates a message along with the context and associated meta-information.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
namespace sysio::chain
Definition authority.cpp:3
std::string string
Definition string.hpp:10
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition reflect.hpp:311
#define FC_REFLECT_ENUM(ENUM, FIELDS)
Definition reflect.hpp:194
console_appender::stream::type stream
std::vector< level_color > level_colors
console_appender::color::type color
level_color(log_level l=log_level::all, color::type c=color::console_default)
cmd_format format
int l