peerplays-fc/include/fc/log/file_appender.hpp
Eric Frias 57d14c7de8 Implement gzip-compression of rotated log files (this effectively
restores the functionality removed in 701b9ac00c,
which had lzma-compression of rotated logs)
2016-08-16 14:20:20 -04:00

35 lines
1.1 KiB
C++

#pragma once
#include <fc/filesystem.hpp>
#include <fc/log/appender.hpp>
#include <fc/log/logger.hpp>
#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;
bool flush = true;
bool rotate = false;
microseconds rotation_interval;
microseconds rotation_limit;
bool rotation_compression = false;
};
file_appender( const variant& args );
~file_appender();
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) )