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

@@ -39,24 +39,24 @@ inline std::shared_ptr<spdlog::logger> spdlog::get(const std::string& name)
// Create multi/single threaded rotating file logger
inline std::shared_ptr<spdlog::logger> spdlog::rotating_logger_mt(const std::string& logger_name, const std::string& filename, size_t max_file_size, size_t max_files, size_t flush_inverval)
inline std::shared_ptr<spdlog::logger> spdlog::rotating_logger_mt(const std::string& logger_name, const std::string& filename, size_t max_file_size, size_t max_files, bool auto_flush)
{
return create<spdlog::sinks::rotating_file_sink_mt>(logger_name, filename, "txt", max_file_size, max_files, flush_inverval);
return create<spdlog::sinks::rotating_file_sink_mt>(logger_name, filename, "txt", max_file_size, max_files, auto_flush);
}
inline std::shared_ptr<spdlog::logger> spdlog::rotating_logger_st(const std::string& logger_name, const std::string& filename, size_t max_file_size, size_t max_files, size_t flush_inverval)
inline std::shared_ptr<spdlog::logger> spdlog::rotating_logger_st(const std::string& logger_name, const std::string& filename, size_t max_file_size, size_t max_files, bool auto_flush)
{
return create<spdlog::sinks::rotating_file_sink_st>(logger_name, filename, "txt", max_file_size, max_files, flush_inverval);
return create<spdlog::sinks::rotating_file_sink_st>(logger_name, filename, "txt", max_file_size, max_files, auto_flush);
}
// Create file logger which creates new file at midnight):
inline std::shared_ptr<spdlog::logger> spdlog::daily_logger_mt(const std::string& logger_name, const std::string& filename, size_t flush_inverval)
inline std::shared_ptr<spdlog::logger> spdlog::daily_logger_mt(const std::string& logger_name, const std::string& filename, bool auto_flush)
{
return create<spdlog::sinks::daily_file_sink_mt>(logger_name, filename, "txt", flush_inverval);
return create<spdlog::sinks::daily_file_sink_mt>(logger_name, filename, "txt", auto_flush);
}
inline std::shared_ptr<spdlog::logger> spdlog::daily_logger_st(const std::string& logger_name, const std::string& filename, size_t flush_inverval)
inline std::shared_ptr<spdlog::logger> spdlog::daily_logger_st(const std::string& logger_name, const std::string& filename, bool auto_flush)
{
return create<spdlog::sinks::daily_file_sink_st>(logger_name, filename, "txt", flush_inverval);
return create<spdlog::sinks::daily_file_sink_st>(logger_name, filename, "txt", auto_flush);
}