replaced flush_interval with auto_flush boolean

This commit is contained in:
gabime
2014-11-25 00:23:55 +02:00
parent c948f15822
commit 68ee9a7ada
5 changed files with 40 additions and 43 deletions

View File

@@ -45,8 +45,8 @@ class simple_file_sink : public base_sink<Mutex>
{
public:
explicit simple_file_sink(const std::string &filename,
const std::size_t flush_inverval=0):
_file_helper(flush_inverval)
bool auto_flush=false):
_file_helper(auto_flush)
{
_file_helper.open(filename);
}
@@ -72,13 +72,13 @@ class rotating_file_sink : public base_sink<Mutex>
public:
rotating_file_sink(const std::string &base_filename, const std::string &extension,
std::size_t max_size, std::size_t max_files,
std::size_t flush_inverval=0):
bool auto_flush=false):
_base_filename(base_filename),
_extension(extension),
_max_size(max_size),
_max_files(max_files),
_current_size(0),
_file_helper(flush_inverval)
_file_helper(auto_flush)
{
_file_helper.open(calc_filename(_base_filename, 0, _extension));
}
@@ -158,11 +158,11 @@ class daily_file_sink:public base_sink<Mutex>
public:
explicit daily_file_sink(const std::string& base_filename,
const std::string& extension,
const std::size_t flush_inverval=0):
bool auto_flush=false):
_base_filename(base_filename),
_extension(extension),
_midnight_tp (_calc_midnight_tp() ),
_file_helper(flush_inverval)
_file_helper(auto_flush)
{
_file_helper.open(calc_filename(_base_filename, _extension));
}