BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet 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 {
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>
47 FC_REFLECT( fc::appender_config, (name)(type)(args)(enabled) )
48 FC_REFLECT( fc::logger_config, (name)(parent)(level)(enabled)(additivity)(appenders) )
49 FC_REFLECT( fc::logging_config, (includes)(appenders)(loggers) )
fc::configure_logging
void configure_logging(const fc::path &log_config)
Definition: logger_config.cpp:18
fc::appender_config::enabled
bool enabled
Definition: logger_config.hpp:18
fc::logger_config::parent
ostring parent
Definition: logger_config.hpp:24
fc
Definition: api.hpp:15
fc::logging_config::includes
std::vector< string > includes
Definition: logger_config.hpp:37
fc::logger_config::add_appender
logger_config & add_appender(const string &s)
Definition: logger_config.cpp:16
fc::logger_config::logger_config
logger_config(const std::string &name="")
Definition: logger_config.hpp:22
reflect.hpp
Defines types and macros used to provide reflection.
fc::logger_config
Definition: logger_config.hpp:21
fc::logging_config
Definition: logger_config.hpp:35
fc::logger_config::level
fc::optional< log_level > level
if not set, then parents level is used.
Definition: logger_config.hpp:26
fc::logger_config::enabled
bool enabled
Definition: logger_config.hpp:27
fc::appender_config::args
variant args
Definition: logger_config.hpp:17
fc::path
wraps boost::filesystem::path to provide platform independent path manipulation.
Definition: filesystem.hpp:28
fc::logging_config::default_config
static logging_config default_config()
Definition: logger_config.cpp:58
fc::logging_config::appenders
std::vector< appender_config > appenders
Definition: logger_config.hpp:38
fc::logger_config::appenders
std::vector< string > appenders
Definition: logger_config.hpp:30
fc::logger_config::additivity
bool additivity
if any appenders are sepecified, then parent's appenders are not set.
Definition: logger_config.hpp:29
fc::variant
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition: variant.hpp:198
std
Definition: zeroed_array.hpp:76
fc::appender_config::appender_config
appender_config(const string &name="", const string &type="", variant args=variant())
Definition: logger_config.hpp:7
logger.hpp
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
fc::appender_config
Definition: logger_config.hpp:6
fc::logging_config::loggers
std::vector< logger_config > loggers
Definition: logger_config.hpp:39
fc::optional< std::string >
fc::appender_config::type
string type
Definition: logger_config.hpp:16
fc::logger_config::name
string name
Definition: logger_config.hpp:23
fc::appender_config::name
string name
Definition: logger_config.hpp:15