1
0
mirror of https://github.com/gabime/spdlog.git synced 2025-03-15 10:39:53 +08:00

code formatting (astyle and dos2unix)

it aims to solve the issue #467
This commit is contained in:
Alexei Pastuchov 2017-06-29 09:51:44 +02:00
parent 9a04e37275
commit 8fd16fc45e
12 changed files with 45 additions and 44 deletions

View File

@ -88,7 +88,7 @@ inline void spdlog::async_logger::_sink_it(details::log_msg& msg)
try
{
#if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)
msg.msg_id = _msg_counter.fetch_add(1, std::memory_order_relaxed);
msg.msg_id = _msg_counter.fetch_add(1, std::memory_order_relaxed);
#endif
_async_log_helper->log(msg);
if (_should_flush_on(msg))

View File

@ -507,7 +507,7 @@ inline bool spdlog::logger::should_log(spdlog::level::level_enum msg_level) cons
inline void spdlog::logger::_sink_it(details::log_msg& msg)
{
#if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)
msg.msg_id = _msg_counter.fetch_add(1, std::memory_order_relaxed);
msg.msg_id = _msg_counter.fetch_add(1, std::memory_order_relaxed);
#endif
_formatter->format(msg);
for (auto &sink : _sinks)

View File

@ -495,7 +495,7 @@ class full_formatter SPDLOG_FINAL:public flag_formatter
// pattern_formatter inline impl
///////////////////////////////////////////////////////////////////////////////
inline spdlog::pattern_formatter::pattern_formatter(const std::string& pattern, pattern_time_type pattern_time)
: _pattern_time(pattern_time)
: _pattern_time(pattern_time)
{
compile_pattern(pattern);
}

View File

@ -126,7 +126,7 @@ public:
std::shared_ptr<async_logger> create_async(const std::string& logger_name, size_t queue_size, const async_overflow_policy overflow_policy, const std::function<void()>& worker_warmup_cb, const std::chrono::milliseconds& flush_interval_ms, const std::function<void()>& worker_teardown_cb, sink_ptr sink)
{
return create_async(logger_name, queue_size, overflow_policy, worker_warmup_cb, flush_interval_ms, worker_teardown_cb, { sink });
return create_async(logger_name, queue_size, overflow_policy, worker_warmup_cb, flush_interval_ms, worker_teardown_cb, { sink });
}
void formatter(formatter_ptr f)

View File

@ -42,7 +42,8 @@ public:
_flush();
}
void set_color(level::level_enum color_level, const std::string& color) {
void set_color(level::level_enum color_level, const std::string& color)
{
std::lock_guard<Mutex> lock(base_sink<Mutex>::_mutex);
colors_[color_level] = color;
}
@ -96,10 +97,10 @@ protected:
_flush();
}
void _flush() override
{
fflush(target_file_);
}
void _flush() override
{
fflush(target_file_);
}
FILE* target_file_;
bool should_do_colors_;
std::map<level::level_enum, std::string> colors_;

View File

@ -36,14 +36,14 @@ public:
std::lock_guard<Mutex> lock(_mutex);
_sink_it(msg);
}
void flush() SPDLOG_FINAL override
{
_flush();
}
void flush() SPDLOG_FINAL override
{
_flush();
}
protected:
virtual void _sink_it(const details::log_msg& msg) = 0;
virtual void _flush() = 0;
virtual void _flush() = 0;
Mutex _mutex;
};
}

View File

@ -44,12 +44,12 @@ protected:
}
}
void _flush() override
{
std::lock_guard<Mutex> lock(base_sink<Mutex>::_mutex);
for (auto &sink : _sinks)
sink->flush();
}
void _flush() override
{
std::lock_guard<Mutex> lock(base_sink<Mutex>::_mutex);
for (auto &sink : _sinks)
sink->flush();
}
public:

View File

@ -46,10 +46,10 @@ protected:
if(_force_flush)
_file_helper.flush();
}
void _flush() override
{
_file_helper.flush();
}
void _flush() override
{
_file_helper.flush();
}
private:
details::file_helper _file_helper;
bool _force_flush;
@ -90,10 +90,10 @@ protected:
_file_helper.write(msg);
}
void _flush() override
{
_file_helper.flush();
}
void _flush() override
{
_file_helper.flush();
}
private:
static filename_t calc_filename(const filename_t& filename, std::size_t index)
@ -208,10 +208,10 @@ protected:
_file_helper.write(msg);
}
void _flush() override
{
_file_helper.flush();
}
void _flush() override
{
_file_helper.flush();
}
private:
std::chrono::system_clock::time_point _next_rotation_tp()

View File

@ -38,8 +38,8 @@ protected:
OutputDebugStringA(msg.formatted.c_str());
}
void _flush() override
{}
void _flush() override
{}
};
typedef msvc_sink<std::mutex> msvc_sink_mt;