peerplays-fc/include/fc/log/file_appender.hpp

37 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
#include <fc/filesystem.hpp>
#include <fc/log/appender.hpp>
#include <fc/log/logger.hpp>
2014-07-02 21:36:21 +00:00
#include <fc/time.hpp>
namespace fc {
class file_appender : public appender {
public:
struct config {
config( const fc::path& p = "log.txt" );
fc::string format;
fc::path filename;
2015-03-26 00:07:19 +00:00
bool flush = true;
bool rotate = false;
2014-07-02 21:36:21 +00:00
microseconds rotation_interval;
microseconds rotation_limit;
bool rotation_compression = false;
uint32_t max_object_depth;
};
file_appender( const variant& args );
~file_appender();
2014-07-02 21:36:21 +00:00
virtual void log( const log_message& m )override;
private:
class impl;
fc::shared_ptr<impl> my;
};
} // namespace fc
#include <fc/reflect/reflect.hpp>
FC_REFLECT( fc::file_appender::config,
(format)(filename)(flush)(rotate)(rotation_interval)(rotation_limit)(rotation_compression)(max_object_depth) )