deleted copy op and a little format

This commit is contained in:
Daniel Chabrowski 2018-02-25 02:43:26 +01:00
parent af50d5ef1f
commit 0c94ce0039
14 changed files with 35 additions and 33 deletions

View File

@ -78,5 +78,4 @@ private:
};
}
#include "details/async_logger_impl.h"

View File

@ -136,6 +136,9 @@ public:
// stop logging and join the back thread
~async_log_helper();
async_log_helper(const async_log_helper&) = delete;
async_log_helper& operator=(const async_log_helper&) = delete;
void set_formatter(formatter_ptr);
void flush(bool wait_for_q);
@ -155,7 +158,6 @@ private:
bool _terminate_requested;
// overflow policy
const async_overflow_policy _overflow_policy;

View File

@ -36,7 +36,7 @@ public:
///////////////////////////////////////////////////////////////////////
namespace
{
class name_formatter:public flag_formatter
class name_formatter : public flag_formatter
{
void format(details::log_msg& msg, const std::tm&) override
{
@ -46,7 +46,7 @@ class name_formatter:public flag_formatter
}
// log level appender
class level_formatter:public flag_formatter
class level_formatter : public flag_formatter
{
void format(details::log_msg& msg, const std::tm&) override
{
@ -55,7 +55,7 @@ class level_formatter:public flag_formatter
};
// short log level appender
class short_level_formatter:public flag_formatter
class short_level_formatter : public flag_formatter
{
void format(details::log_msg& msg, const std::tm&) override
{
@ -79,7 +79,7 @@ static int to12h(const tm& t)
//Abbreviated weekday name
static const std::string days[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
class a_formatter:public flag_formatter
class a_formatter : public flag_formatter
{
void format(details::log_msg& msg, const std::tm& tm_time) override
{
@ -89,7 +89,7 @@ class a_formatter:public flag_formatter
//Full weekday name
static const std::string full_days[] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
class A_formatter:public flag_formatter
class A_formatter : public flag_formatter
{
void format(details::log_msg& msg, const std::tm& tm_time) override
{
@ -99,7 +99,7 @@ class A_formatter:public flag_formatter
//Abbreviated month
static const std::string months[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec" };
class b_formatter:public flag_formatter
class b_formatter : public flag_formatter
{
void format(details::log_msg& msg, const std::tm& tm_time) override
{
@ -109,7 +109,7 @@ class b_formatter:public flag_formatter
//Full month name
static const std::string full_months[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
class B_formatter:public flag_formatter
class B_formatter : public flag_formatter
{
void format(details::log_msg& msg, const std::tm& tm_time) override
{

View File

@ -214,9 +214,9 @@ private:
bool _async_mode = false;
size_t _async_q_size = 0;
async_overflow_policy _overflow_policy = async_overflow_policy::block_retry;
std::function<void()> _worker_warmup_cb = nullptr;
std::chrono::milliseconds _flush_interval_ms{ 0 };
std::function<void()> _worker_teardown_cb = nullptr;
std::function<void()> _worker_warmup_cb;
std::chrono::milliseconds _flush_interval_ms;
std::function<void()> _worker_teardown_cb;
};
#ifdef SPDLOG_NO_REGISTRY_MUTEX

View File

@ -25,7 +25,7 @@ template<class Mutex>
class base_sink : public sink
{
public:
base_sink():_mutex() {}
base_sink() = default;
base_sink(const base_sink&) = delete;
base_sink& operator=(const base_sink&) = delete;

View File

@ -15,6 +15,7 @@ class sink
{
public:
virtual ~sink() = default;
virtual void log(const details::log_msg& msg) = 0;
virtual void flush() = 0;