deleted copy op and a little format
This commit is contained in:
parent
af50d5ef1f
commit
0c94ce0039
@ -78,5 +78,4 @@ private:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "details/async_logger_impl.h"
|
#include "details/async_logger_impl.h"
|
||||||
|
@ -136,6 +136,9 @@ public:
|
|||||||
// stop logging and join the back thread
|
// stop logging and join the back thread
|
||||||
~async_log_helper();
|
~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 set_formatter(formatter_ptr);
|
||||||
|
|
||||||
void flush(bool wait_for_q);
|
void flush(bool wait_for_q);
|
||||||
@ -155,7 +158,6 @@ private:
|
|||||||
|
|
||||||
bool _terminate_requested;
|
bool _terminate_requested;
|
||||||
|
|
||||||
|
|
||||||
// overflow policy
|
// overflow policy
|
||||||
const async_overflow_policy _overflow_policy;
|
const async_overflow_policy _overflow_policy;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public:
|
|||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
class name_formatter:public flag_formatter
|
class name_formatter : public flag_formatter
|
||||||
{
|
{
|
||||||
void format(details::log_msg& msg, const std::tm&) override
|
void format(details::log_msg& msg, const std::tm&) override
|
||||||
{
|
{
|
||||||
@ -46,7 +46,7 @@ class name_formatter:public flag_formatter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// log level appender
|
// 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
|
void format(details::log_msg& msg, const std::tm&) override
|
||||||
{
|
{
|
||||||
@ -55,7 +55,7 @@ class level_formatter:public flag_formatter
|
|||||||
};
|
};
|
||||||
|
|
||||||
// short log level appender
|
// 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
|
void format(details::log_msg& msg, const std::tm&) override
|
||||||
{
|
{
|
||||||
@ -79,7 +79,7 @@ static int to12h(const tm& t)
|
|||||||
|
|
||||||
//Abbreviated weekday name
|
//Abbreviated weekday name
|
||||||
static const std::string days[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
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
|
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
|
//Full weekday name
|
||||||
static const std::string full_days[] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
|
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
|
void format(details::log_msg& msg, const std::tm& tm_time) override
|
||||||
{
|
{
|
||||||
@ -99,7 +99,7 @@ class A_formatter:public flag_formatter
|
|||||||
|
|
||||||
//Abbreviated month
|
//Abbreviated month
|
||||||
static const std::string months[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec" };
|
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
|
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
|
//Full month name
|
||||||
static const std::string full_months[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
|
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
|
void format(details::log_msg& msg, const std::tm& tm_time) override
|
||||||
{
|
{
|
||||||
|
@ -214,9 +214,9 @@ private:
|
|||||||
bool _async_mode = false;
|
bool _async_mode = false;
|
||||||
size_t _async_q_size = 0;
|
size_t _async_q_size = 0;
|
||||||
async_overflow_policy _overflow_policy = async_overflow_policy::block_retry;
|
async_overflow_policy _overflow_policy = async_overflow_policy::block_retry;
|
||||||
std::function<void()> _worker_warmup_cb = nullptr;
|
std::function<void()> _worker_warmup_cb;
|
||||||
std::chrono::milliseconds _flush_interval_ms{ 0 };
|
std::chrono::milliseconds _flush_interval_ms;
|
||||||
std::function<void()> _worker_teardown_cb = nullptr;
|
std::function<void()> _worker_teardown_cb;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SPDLOG_NO_REGISTRY_MUTEX
|
#ifdef SPDLOG_NO_REGISTRY_MUTEX
|
||||||
|
@ -25,7 +25,7 @@ template<class Mutex>
|
|||||||
class base_sink : public sink
|
class base_sink : public sink
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
base_sink():_mutex() {}
|
base_sink() = default;
|
||||||
|
|
||||||
base_sink(const base_sink&) = delete;
|
base_sink(const base_sink&) = delete;
|
||||||
base_sink& operator=(const base_sink&) = delete;
|
base_sink& operator=(const base_sink&) = delete;
|
||||||
|
@ -15,6 +15,7 @@ class sink
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~sink() = default;
|
virtual ~sink() = default;
|
||||||
|
|
||||||
virtual void log(const details::log_msg& msg) = 0;
|
virtual void log(const details::log_msg& msg) = 0;
|
||||||
virtual void flush() = 0;
|
virtual void flush() = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user