BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
file_appender.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <fc/filesystem.hpp>
4 #include <fc/log/appender.hpp>
5 #include <fc/log/logger.hpp>
6 #include <fc/time.hpp>
7 
8 namespace fc {
9 
10 class file_appender : public appender {
11  public:
12  struct config {
13  config( const fc::path& p = "log.txt" );
14 
15  std::string format;
17  bool flush = true;
18  bool rotate = false;
22  };
23  file_appender( const variant& args );
25  virtual void log( const log_message& m )override;
26 
27  private:
28  class impl;
29  std::unique_ptr<impl> my;
30  };
31 } // namespace fc
32 
33 #include <fc/reflect/reflect.hpp>
35  (format)(filename)(flush)(rotate)(rotation_interval)(rotation_limit)(max_object_depth) )
appender.hpp
fc::file_appender::config::config
config(const fc::path &p="log.txt")
Definition: file_appender.cpp:143
fc::file_appender::config::flush
bool flush
Definition: file_appender.hpp:17
fc::file_appender::file_appender
file_appender(const variant &args)
Definition: file_appender.cpp:150
fc
Definition: api.hpp:15
fc::file_appender::config::max_object_depth
uint32_t max_object_depth
Definition: file_appender.hpp:21
fc::appender
Definition: appender.hpp:28
filesystem.hpp
FC_MAX_LOG_OBJECT_DEPTH
#define FC_MAX_LOG_OBJECT_DEPTH
Definition: config.hpp:8
reflect.hpp
Defines types and macros used to provide reflection.
fc::file_appender::config
Definition: file_appender.hpp:12
fc::file_appender::config::format
std::string format
Definition: file_appender.hpp:15
fc::file_appender::config::rotation_limit
microseconds rotation_limit
Definition: file_appender.hpp:20
fc::path
wraps boost::filesystem::path to provide platform independent path manipulation.
Definition: filesystem.hpp:28
fc::file_appender::config::filename
fc::path filename
Definition: file_appender.hpp:16
fc::file_appender::log
virtual void log(const log_message &m) override
Definition: file_appender.cpp:157
fc::file_appender::config::rotate
bool rotate
Definition: file_appender.hpp:18
fc::file_appender::impl
Definition: file_appender.cpp:16
fc::microseconds
Definition: time.hpp:12
fc::file_appender
Definition: file_appender.hpp:10
fc::log_message
aggregates a message along with the context and associated meta-information.
Definition: log_message.hpp:106
fc::variant
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition: variant.hpp:198
logger.hpp
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
time.hpp
fc::file_appender::config::rotation_interval
microseconds rotation_interval
Definition: file_appender.hpp:19
fc::file_appender::~file_appender
~file_appender()
Definition: file_appender.cpp:154