BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface software
logger_config.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <fc/log/logger.hpp>
3 
4 namespace fc {
5  class path;
6  struct appender_config {
7  appender_config(const string& name = "",
8  const string& type = "",
9  variant args = variant()) :
10  name(name),
11  type(type),
12  args(std::move(args)),
13  enabled(true)
14  {}
15  string name;
16  string type;
18  bool enabled;
19  };
20 
21  struct logger_config {
22  logger_config(const std::string& name = ""):name(name),enabled(true),additivity(false){}
23  string name;
27  bool enabled;
29  bool additivity;
30  std::vector<string> appenders;
31 
32  logger_config& add_appender( const string& s );
33  };
34 
35  struct logging_config {
36  static logging_config default_config();
37  std::vector<string> includes;
38  std::vector<appender_config> appenders;
39  std::vector<logger_config> loggers;
40  };
41 
42  void configure_logging( const fc::path& log_config );
43  bool configure_logging( const logging_config& l );
44 }
45 
46 #include <fc/reflect/reflect.hpp>
48 FC_REFLECT( fc::logger_config, (name)(parent)(level)(enabled)(additivity)(appenders) )
49 FC_REFLECT( fc::logging_config, (includes)(appenders)(loggers) )
std::vector< string > includes
std::vector< logger_config > loggers
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:386
Defines types and macros used to provide reflection.
std::vector< string > appenders
fc::optional< log_level > level
if not set, then parents level is used.
logger_config(const std::string &name="")
void configure_logging(const fc::path &log_config)
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object&#39;s.
Definition: variant.hpp:198
std::vector< appender_config > appenders
appender_config(const string &name="", const string &type="", variant args=variant())
Definition: api.hpp:15
bool additivity
if any appenders are sepecified, then parent&#39;s appenders are not set.
wraps boost::filesystem::path to provide platform independent path manipulation.
Definition: filesystem.hpp:28