mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-24 17:41:34 +08:00
reformat code
This commit is contained in:
parent
1800775b9d
commit
f36b2c5f93
@ -41,9 +41,9 @@ public:
|
||||
It end,
|
||||
std::weak_ptr<details::thread_pool> tp,
|
||||
async_overflow_policy overflow_policy = async_overflow_policy::block)
|
||||
: logger(std::move(logger_name), begin, end)
|
||||
, thread_pool_(std::move(tp))
|
||||
, overflow_policy_(overflow_policy) {}
|
||||
: logger(std::move(logger_name), begin, end),
|
||||
thread_pool_(std::move(tp)),
|
||||
overflow_policy_(overflow_policy) {}
|
||||
|
||||
async_logger(std::string logger_name,
|
||||
sinks_init_list sinks_list,
|
||||
|
@ -229,9 +229,9 @@ struct source_loc {
|
||||
constexpr source_loc(const char *filename_in,
|
||||
std::uint_least32_t line_in,
|
||||
const char *funcname_in)
|
||||
: filename{filename_in}
|
||||
, line{line_in}
|
||||
, funcname{funcname_in} {}
|
||||
: filename{filename_in},
|
||||
line{line_in},
|
||||
funcname{funcname_in} {}
|
||||
|
||||
#ifdef SPDLOG_HAVE_STD_SOURCE_LOCATION
|
||||
static constexpr source_loc
|
||||
@ -262,23 +262,23 @@ struct loc_with_fmt {
|
||||
string_view_t fmt_string;
|
||||
template <typename S, typename = is_convertible_to_sv<S>>
|
||||
constexpr loc_with_fmt(S fmt_str, source_loc loc = source_loc::current()) noexcept
|
||||
: loc(loc)
|
||||
, fmt_string(fmt_str) {}
|
||||
: loc(loc),
|
||||
fmt_string(fmt_str) {}
|
||||
|
||||
#ifndef SPDLOG_USE_STD_FORMAT
|
||||
constexpr loc_with_fmt(fmt::runtime_format_string<char> fmt_str,
|
||||
source_loc loc = source_loc::current()) noexcept
|
||||
: loc(loc)
|
||||
, fmt_string(fmt_str.str) {}
|
||||
: loc(loc),
|
||||
fmt_string(fmt_str.str) {}
|
||||
#endif
|
||||
};
|
||||
|
||||
struct file_event_handlers {
|
||||
file_event_handlers()
|
||||
: before_open(nullptr)
|
||||
, after_open(nullptr)
|
||||
, before_close(nullptr)
|
||||
, after_close(nullptr) {}
|
||||
: before_open(nullptr),
|
||||
after_open(nullptr),
|
||||
before_close(nullptr),
|
||||
after_close(nullptr) {}
|
||||
|
||||
std::function<void(const filename_t &filename)> before_open;
|
||||
std::function<void(const filename_t &filename, std::FILE *file_stream)> after_open;
|
||||
|
@ -25,7 +25,8 @@ public:
|
||||
|
||||
explicit circular_q(size_t max_items)
|
||||
: max_items_(max_items + 1) // one item is reserved as marker for full q
|
||||
, v_(max_items_) {}
|
||||
,
|
||||
v_(max_items_) {}
|
||||
|
||||
circular_q(const circular_q &) = default;
|
||||
circular_q &operator=(const circular_q &) = default;
|
||||
|
@ -38,9 +38,9 @@ struct async_msg : log_msg_buffer {
|
||||
// support for vs2013 move
|
||||
#if defined(_MSC_VER) && _MSC_VER <= 1800
|
||||
async_msg(async_msg &&other)
|
||||
: log_msg_buffer(std::move(other))
|
||||
, msg_type(other.msg_type)
|
||||
, worker_ptr(std::move(other.worker_ptr)) {}
|
||||
: log_msg_buffer(std::move(other)),
|
||||
msg_type(other.msg_type),
|
||||
worker_ptr(std::move(other.worker_ptr)) {}
|
||||
|
||||
async_msg &operator=(async_msg &&other) {
|
||||
*static_cast<log_msg_buffer *>(this) = std::move(other);
|
||||
@ -55,14 +55,14 @@ struct async_msg : log_msg_buffer {
|
||||
|
||||
// construct from log_msg with given type
|
||||
async_msg(async_logger_ptr &&worker, async_msg_type the_type, const details::log_msg &m)
|
||||
: log_msg_buffer{m}
|
||||
, msg_type{the_type}
|
||||
, worker_ptr{std::move(worker)} {}
|
||||
: log_msg_buffer{m},
|
||||
msg_type{the_type},
|
||||
worker_ptr{std::move(worker)} {}
|
||||
|
||||
async_msg(async_logger_ptr &&worker, async_msg_type the_type)
|
||||
: log_msg_buffer{}
|
||||
, msg_type{the_type}
|
||||
, worker_ptr{std::move(worker)} {}
|
||||
: log_msg_buffer{},
|
||||
msg_type{the_type},
|
||||
worker_ptr{std::move(worker)} {}
|
||||
|
||||
explicit async_msg(async_msg_type the_type)
|
||||
: async_msg{nullptr, the_type} {}
|
||||
|
@ -43,9 +43,9 @@ template <typename It>
|
||||
class dump_info {
|
||||
public:
|
||||
dump_info(It range_begin, It range_end, size_t size_per_line)
|
||||
: begin_(range_begin)
|
||||
, end_(range_end)
|
||||
, size_per_line_(size_per_line) {}
|
||||
: begin_(range_begin),
|
||||
end_(range_end),
|
||||
size_per_line_(size_per_line) {}
|
||||
|
||||
// do not use begin() and end() to avoid collision with fmt/ranges
|
||||
It get_begin() const { return begin_; }
|
||||
|
@ -50,8 +50,8 @@ public:
|
||||
// Logger with range on sinks
|
||||
template <typename It>
|
||||
logger(std::string name, It begin, It end)
|
||||
: name_(std::move(name))
|
||||
, sinks_(begin, end) {}
|
||||
: name_(std::move(name)),
|
||||
sinks_(begin, end) {}
|
||||
|
||||
// Logger with single sink
|
||||
logger(std::string name, sink_ptr single_sink)
|
||||
|
@ -25,10 +25,10 @@ struct padding_info {
|
||||
|
||||
padding_info() = default;
|
||||
padding_info(size_t width, padding_info::pad_side side, bool truncate)
|
||||
: width_(width)
|
||||
, side_(side)
|
||||
, truncate_(truncate)
|
||||
, enabled_(true) {}
|
||||
: width_(width),
|
||||
side_(side),
|
||||
truncate_(truncate),
|
||||
enabled_(true) {}
|
||||
|
||||
bool enabled() const { return enabled_; }
|
||||
size_t width_ = 0;
|
||||
|
@ -34,8 +34,8 @@ template <typename Mutex, int BufferID = log_id::LOG_ID_MAIN>
|
||||
class android_sink final : public base_sink<Mutex> {
|
||||
public:
|
||||
explicit android_sink(std::string tag = "spdlog", bool use_raw_msg = false)
|
||||
: tag_(std::move(tag))
|
||||
, use_raw_msg_(use_raw_msg) {}
|
||||
: tag_(std::move(tag)),
|
||||
use_raw_msg_(use_raw_msg) {}
|
||||
|
||||
protected:
|
||||
void sink_it_(const details::log_msg &msg) override {
|
||||
|
@ -72,13 +72,13 @@ public:
|
||||
bool truncate = false,
|
||||
uint16_t max_files = 0,
|
||||
const file_event_handlers &event_handlers = {})
|
||||
: base_filename_(std::move(base_filename))
|
||||
, rotation_h_(rotation_hour)
|
||||
, rotation_m_(rotation_minute)
|
||||
, file_helper_{event_handlers}
|
||||
, truncate_(truncate)
|
||||
, max_files_(max_files)
|
||||
, filenames_q_() {
|
||||
: base_filename_(std::move(base_filename)),
|
||||
rotation_h_(rotation_hour),
|
||||
rotation_m_(rotation_minute),
|
||||
file_helper_{event_handlers},
|
||||
truncate_(truncate),
|
||||
max_files_(max_files),
|
||||
filenames_q_() {
|
||||
if (rotation_hour < 0 || rotation_hour > 23 || rotation_minute < 0 ||
|
||||
rotation_minute > 59) {
|
||||
throw_spdlog_ex("daily_file_sink: Invalid rotation time in ctor");
|
||||
|
@ -42,8 +42,8 @@ public:
|
||||
template <class Rep, class Period>
|
||||
explicit dup_filter_sink(std::chrono::duration<Rep, Period> max_skip_duration,
|
||||
level notification_level = level::info)
|
||||
: max_skip_duration_{max_skip_duration}
|
||||
, log_level_{notification_level} {}
|
||||
: max_skip_duration_{max_skip_duration},
|
||||
log_level_{notification_level} {}
|
||||
|
||||
protected:
|
||||
std::chrono::microseconds max_skip_duration_;
|
||||
|
@ -48,11 +48,11 @@ public:
|
||||
bool truncate = false,
|
||||
uint16_t max_files = 0,
|
||||
const file_event_handlers &event_handlers = {})
|
||||
: base_filename_(std::move(base_filename))
|
||||
, file_helper_{event_handlers}
|
||||
, truncate_(truncate)
|
||||
, max_files_(max_files)
|
||||
, filenames_q_() {
|
||||
: base_filename_(std::move(base_filename)),
|
||||
file_helper_{event_handlers},
|
||||
truncate_(truncate),
|
||||
max_files_(max_files),
|
||||
filenames_q_() {
|
||||
auto now = log_clock::now();
|
||||
auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(now));
|
||||
file_helper_.open(filename, truncate_);
|
||||
|
@ -30,9 +30,9 @@ struct kafka_sink_config {
|
||||
int32_t flush_timeout_ms = 1000;
|
||||
|
||||
kafka_sink_config(std::string addr, std::string topic, int flush_timeout_ms = 1000)
|
||||
: server_addr{std::move(addr)}
|
||||
, produce_topic{std::move(topic)}
|
||||
, flush_timeout_ms(flush_timeout_ms) {}
|
||||
: server_addr{std::move(addr)},
|
||||
produce_topic{std::move(topic)},
|
||||
flush_timeout_ms(flush_timeout_ms) {}
|
||||
};
|
||||
|
||||
template <typename Mutex>
|
||||
|
@ -40,9 +40,9 @@ public:
|
||||
const std::string &db_name,
|
||||
const std::string &collection_name,
|
||||
const std::string &uri = "mongodb://localhost:27017")
|
||||
: instance_(std::move(instance))
|
||||
, db_name_(db_name)
|
||||
, coll_name_(collection_name) {
|
||||
: instance_(std::move(instance)),
|
||||
db_name_(db_name),
|
||||
coll_name_(collection_name) {
|
||||
try {
|
||||
client_ = spdlog::std::make_unique<mongocxx::client>(mongocxx::uri{uri});
|
||||
} catch (const std::exception &e) {
|
||||
|
@ -15,8 +15,8 @@ template <typename Mutex>
|
||||
class ostream_sink final : public base_sink<Mutex> {
|
||||
public:
|
||||
explicit ostream_sink(std::ostream &os, bool force_flush = false)
|
||||
: ostream_(os)
|
||||
, force_flush_(force_flush) {}
|
||||
: ostream_(os),
|
||||
force_flush_(force_flush) {}
|
||||
ostream_sink(const ostream_sink &) = delete;
|
||||
ostream_sink &operator=(const ostream_sink &) = delete;
|
||||
|
||||
|
@ -30,8 +30,8 @@ template <typename Mutex>
|
||||
class qt_sink : public base_sink<Mutex> {
|
||||
public:
|
||||
qt_sink(QObject *qt_object, std::string meta_method)
|
||||
: qt_object_(qt_object)
|
||||
, meta_method_(std::move(meta_method)) {
|
||||
: qt_object_(qt_object),
|
||||
meta_method_(std::move(meta_method)) {
|
||||
if (!qt_object_) {
|
||||
throw_spdlog_ex("qt_sink: qt_object is null");
|
||||
}
|
||||
@ -69,9 +69,9 @@ public:
|
||||
int max_lines,
|
||||
bool dark_colors = false,
|
||||
bool is_utf8 = false)
|
||||
: qt_text_edit_(qt_text_edit)
|
||||
, max_lines_(max_lines)
|
||||
, is_utf8_(is_utf8) {
|
||||
: qt_text_edit_(qt_text_edit),
|
||||
max_lines_(max_lines),
|
||||
is_utf8_(is_utf8) {
|
||||
if (!qt_text_edit_) {
|
||||
throw_spdlog_ex("qt_color_text_sink: text_edit is null");
|
||||
}
|
||||
@ -131,13 +131,13 @@ protected:
|
||||
QTextCharFormat level_color,
|
||||
int color_range_start,
|
||||
int color_range_end)
|
||||
: max_lines(max_lines)
|
||||
, q_text_edit(q_text_edit)
|
||||
, payload(std::move(payload))
|
||||
, default_color(default_color)
|
||||
, level_color(level_color)
|
||||
, color_range_start(color_range_start)
|
||||
, color_range_end(color_range_end) {}
|
||||
: max_lines(max_lines),
|
||||
q_text_edit(q_text_edit),
|
||||
payload(std::move(payload)),
|
||||
default_color(default_color),
|
||||
level_color(level_color),
|
||||
color_range_start(color_range_start),
|
||||
color_range_end(color_range_end) {}
|
||||
int max_lines;
|
||||
QTextEdit *q_text_edit;
|
||||
QString payload;
|
||||
|
@ -21,15 +21,15 @@ class syslog_sink : public base_sink<Mutex> {
|
||||
|
||||
public:
|
||||
syslog_sink(std::string ident, int syslog_option, int syslog_facility, bool enable_formatting)
|
||||
: enable_formatting_{enable_formatting}
|
||||
, syslog_levels_{{/* spdlog::level::trace */ LOG_DEBUG,
|
||||
: enable_formatting_{enable_formatting},
|
||||
syslog_levels_{{/* spdlog::level::trace */ LOG_DEBUG,
|
||||
/* spdlog::level::debug */ LOG_DEBUG,
|
||||
/* spdlog::level::info */ LOG_INFO,
|
||||
/* spdlog::level::warn */ LOG_WARNING,
|
||||
/* spdlog::level::err */ LOG_ERR,
|
||||
/* spdlog::level::critical */ LOG_CRIT,
|
||||
/* spdlog::level::off */ LOG_INFO}}
|
||||
, ident_{std::move(ident)} {
|
||||
/* spdlog::level::off */ LOG_INFO}},
|
||||
ident_{std::move(ident)} {
|
||||
// set ident to be program name if empty
|
||||
::openlog(ident_.empty() ? nullptr : ident_.c_str(), syslog_option, syslog_facility);
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ template <typename Mutex>
|
||||
class systemd_sink : public base_sink<Mutex> {
|
||||
public:
|
||||
systemd_sink(std::string ident = "", bool enable_formatting = false)
|
||||
: ident_{std::move(ident)}
|
||||
, enable_formatting_{enable_formatting}
|
||||
, syslog_levels_{{/* spdlog::level::trace */ LOG_DEBUG,
|
||||
: ident_{std::move(ident)},
|
||||
enable_formatting_{enable_formatting},
|
||||
syslog_levels_{{/* spdlog::level::trace */ LOG_DEBUG,
|
||||
/* spdlog::level::debug */ LOG_DEBUG,
|
||||
/* spdlog::level::info */ LOG_INFO,
|
||||
/* spdlog::level::warn */ LOG_WARNING,
|
||||
|
@ -34,8 +34,8 @@ struct tcp_sink_config {
|
||||
bool lazy_connect = false; // if true connect on first log call instead of on construction
|
||||
|
||||
tcp_sink_config(std::string host, int port)
|
||||
: server_host{std::move(host)}
|
||||
, server_port{port} {}
|
||||
: server_host{std::move(host)},
|
||||
server_port{port} {}
|
||||
};
|
||||
|
||||
template <typename Mutex>
|
||||
|
@ -28,8 +28,8 @@ struct udp_sink_config {
|
||||
uint16_t server_port;
|
||||
|
||||
udp_sink_config(std::string host, uint16_t port)
|
||||
: server_host{std::move(host)}
|
||||
, server_port{port} {}
|
||||
: server_host{std::move(host)},
|
||||
server_port{port} {}
|
||||
};
|
||||
|
||||
template <typename Mutex>
|
||||
|
@ -227,8 +227,8 @@ protected:
|
||||
public:
|
||||
win_eventlog_sink(std::string const &source,
|
||||
DWORD event_id = 1000 /* according to mscoree.dll */)
|
||||
: source_(source)
|
||||
, event_id_(event_id) {
|
||||
: source_(source),
|
||||
event_id_(event_id) {
|
||||
try {
|
||||
current_user_sid_ = internal::sid_t::get_current_user_sid();
|
||||
} catch (...) {
|
||||
|
@ -12,14 +12,16 @@ log_msg::log_msg(spdlog::log_clock::time_point log_time,
|
||||
string_view_t a_logger_name,
|
||||
spdlog::level lvl,
|
||||
spdlog::string_view_t msg)
|
||||
: logger_name(a_logger_name)
|
||||
, log_level(lvl)
|
||||
, time(log_time)
|
||||
: logger_name(a_logger_name),
|
||||
log_level(lvl),
|
||||
time(log_time)
|
||||
#ifndef SPDLOG_NO_THREAD_ID
|
||||
, thread_id(os::thread_id())
|
||||
,
|
||||
thread_id(os::thread_id())
|
||||
#endif
|
||||
, source(loc)
|
||||
, payload(msg) {
|
||||
,
|
||||
source(loc),
|
||||
payload(msg) {
|
||||
}
|
||||
|
||||
log_msg::log_msg(spdlog::source_loc loc,
|
||||
|
@ -21,8 +21,8 @@ log_msg_buffer::log_msg_buffer(const log_msg_buffer &other)
|
||||
}
|
||||
|
||||
log_msg_buffer::log_msg_buffer(log_msg_buffer &&other) noexcept
|
||||
: log_msg{other}
|
||||
, buffer{std::move(other.buffer)} {
|
||||
: log_msg{other},
|
||||
buffer{std::move(other.buffer)} {
|
||||
update_string_views();
|
||||
}
|
||||
|
||||
|
@ -12,18 +12,18 @@ namespace spdlog {
|
||||
|
||||
// public methods
|
||||
logger::logger(const logger &other) noexcept
|
||||
: name_(other.name_)
|
||||
, sinks_(other.sinks_)
|
||||
, level_(other.level_.load(std::memory_order_relaxed))
|
||||
, flush_level_(other.flush_level_.load(std::memory_order_relaxed))
|
||||
, custom_err_handler_(other.custom_err_handler_) {}
|
||||
: name_(other.name_),
|
||||
sinks_(other.sinks_),
|
||||
level_(other.level_.load(std::memory_order_relaxed)),
|
||||
flush_level_(other.flush_level_.load(std::memory_order_relaxed)),
|
||||
custom_err_handler_(other.custom_err_handler_) {}
|
||||
|
||||
logger::logger(logger &&other) noexcept
|
||||
: name_(std::move(other.name_))
|
||||
, sinks_(std::move(other.sinks_))
|
||||
, level_(other.level_.load(std::memory_order_relaxed))
|
||||
, flush_level_(other.flush_level_.load(std::memory_order_relaxed))
|
||||
, custom_err_handler_(std::move(other.custom_err_handler_)) {}
|
||||
: name_(std::move(other.name_)),
|
||||
sinks_(std::move(other.sinks_)),
|
||||
level_(other.level_.load(std::memory_order_relaxed)),
|
||||
flush_level_(other.flush_level_.load(std::memory_order_relaxed)),
|
||||
custom_err_handler_(std::move(other.custom_err_handler_)) {}
|
||||
|
||||
void logger::set_level(level level) { level_.store(level); }
|
||||
|
||||
|
@ -27,8 +27,8 @@ namespace details {
|
||||
class scoped_padder {
|
||||
public:
|
||||
scoped_padder(size_t wrapped_size, const padding_info &padinfo, memory_buf_t &dest)
|
||||
: padinfo_(padinfo)
|
||||
, dest_(dest) {
|
||||
: padinfo_(padinfo),
|
||||
dest_(dest) {
|
||||
remaining_pad_ = static_cast<long>(padinfo.width_) - static_cast<long>(wrapped_size);
|
||||
if (remaining_pad_ <= 0) {
|
||||
return;
|
||||
@ -756,8 +756,8 @@ public:
|
||||
using DurationUnits = Units;
|
||||
|
||||
explicit elapsed_formatter(padding_info padinfo)
|
||||
: flag_formatter(padinfo)
|
||||
, last_message_time_(log_clock::now()) {}
|
||||
: flag_formatter(padinfo),
|
||||
last_message_time_(log_clock::now()) {}
|
||||
|
||||
void format(const details::log_msg &msg, const std::tm &, memory_buf_t &dest) override {
|
||||
auto delta = (std::max)(msg.time - last_message_time_, log_clock::duration::zero());
|
||||
@ -863,23 +863,23 @@ pattern_formatter::pattern_formatter(std::string pattern,
|
||||
pattern_time_type time_type,
|
||||
std::string eol,
|
||||
custom_flags custom_user_flags)
|
||||
: pattern_(std::move(pattern))
|
||||
, eol_(std::move(eol))
|
||||
, pattern_time_type_(time_type)
|
||||
, need_localtime_(false)
|
||||
, last_log_secs_(0)
|
||||
, custom_handlers_(std::move(custom_user_flags)) {
|
||||
: pattern_(std::move(pattern)),
|
||||
eol_(std::move(eol)),
|
||||
pattern_time_type_(time_type),
|
||||
need_localtime_(false),
|
||||
last_log_secs_(0),
|
||||
custom_handlers_(std::move(custom_user_flags)) {
|
||||
std::memset(&cached_tm_, 0, sizeof(cached_tm_));
|
||||
compile_pattern_(pattern_);
|
||||
}
|
||||
|
||||
// use by default full formatter for if pattern is not given
|
||||
pattern_formatter::pattern_formatter(pattern_time_type time_type, std::string eol)
|
||||
: pattern_("%+")
|
||||
, eol_(std::move(eol))
|
||||
, pattern_time_type_(time_type)
|
||||
, need_localtime_(true)
|
||||
, last_log_secs_(0) {
|
||||
: pattern_("%+"),
|
||||
eol_(std::move(eol)),
|
||||
pattern_time_type_(time_type),
|
||||
need_localtime_(true),
|
||||
last_log_secs_(0) {
|
||||
std::memset(&cached_tm_, 0, sizeof(cached_tm_));
|
||||
formatters_.push_back(std::make_unique<details::full_formatter>(details::padding_info{}));
|
||||
}
|
||||
|
@ -11,9 +11,9 @@ namespace sinks {
|
||||
|
||||
template <typename ConsoleMutex>
|
||||
ansicolor_sink<ConsoleMutex>::ansicolor_sink(FILE *target_file, color_mode mode)
|
||||
: target_file_(target_file)
|
||||
, mutex_(ConsoleMutex::mutex())
|
||||
, formatter_(std::make_unique<spdlog::pattern_formatter>())
|
||||
: target_file_(target_file),
|
||||
mutex_(ConsoleMutex::mutex()),
|
||||
formatter_(std::make_unique<spdlog::pattern_formatter>())
|
||||
|
||||
{
|
||||
set_color_mode(mode);
|
||||
|
@ -22,10 +22,10 @@ rotating_file_sink<Mutex>::rotating_file_sink(filename_t base_filename,
|
||||
std::size_t max_files,
|
||||
bool rotate_on_open,
|
||||
const file_event_handlers &event_handlers)
|
||||
: base_filename_(std::move(base_filename))
|
||||
, max_size_(max_size)
|
||||
, max_files_(max_files)
|
||||
, file_helper_{event_handlers} {
|
||||
: base_filename_(std::move(base_filename)),
|
||||
max_size_(max_size),
|
||||
max_files_(max_files),
|
||||
file_helper_{event_handlers} {
|
||||
if (max_size == 0) {
|
||||
throw_spdlog_ex("rotating sink constructor: max_size arg cannot be zero");
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ namespace sinks {
|
||||
|
||||
template <typename ConsoleMutex>
|
||||
stdout_sink_base<ConsoleMutex>::stdout_sink_base(FILE *file)
|
||||
: mutex_(ConsoleMutex::mutex())
|
||||
, file_(file)
|
||||
, formatter_(std::make_unique<spdlog::pattern_formatter>()) {
|
||||
: mutex_(ConsoleMutex::mutex()),
|
||||
file_(file),
|
||||
formatter_(std::make_unique<spdlog::pattern_formatter>()) {
|
||||
#ifdef _WIN32
|
||||
// get windows handle from the FILE* object
|
||||
|
||||
|
@ -13,9 +13,9 @@ namespace spdlog {
|
||||
namespace sinks {
|
||||
template <typename ConsoleMutex>
|
||||
wincolor_sink<ConsoleMutex>::wincolor_sink(void *out_handle, color_mode mode)
|
||||
: out_handle_(out_handle)
|
||||
, mutex_(ConsoleMutex::mutex())
|
||||
, formatter_(std::make_unique<spdlog::pattern_formatter>()) {
|
||||
: out_handle_(out_handle),
|
||||
mutex_(ConsoleMutex::mutex()),
|
||||
formatter_(std::make_unique<spdlog::pattern_formatter>()) {
|
||||
set_color_mode_impl(mode);
|
||||
// set level colors
|
||||
colors_.at(level_to_number(level::trace)) =
|
||||
|
Loading…
Reference in New Issue
Block a user