mirror of
https://github.com/gabime/spdlog.git
synced 2025-05-01 20:43:52 +00:00
clang format
This commit is contained in:
parent
2ecc00e9c6
commit
6cac90b89a
@ -46,7 +46,6 @@ void bench_threaded_logging(size_t threads, int iters)
|
|||||||
auto basic_mt = spdlog::basic_logger_mt("basic_mt", "logs/basic_mt.log", true);
|
auto basic_mt = spdlog::basic_logger_mt("basic_mt", "logs/basic_mt.log", true);
|
||||||
bench_mt(iters, std::move(basic_mt), threads);
|
bench_mt(iters, std::move(basic_mt), threads);
|
||||||
|
|
||||||
|
|
||||||
spdlog::info("");
|
spdlog::info("");
|
||||||
auto rotating_mt = spdlog::rotating_logger_mt("rotating_mt", "logs/rotating_mt.log", file_size, rotating_files);
|
auto rotating_mt = spdlog::rotating_logger_mt("rotating_mt", "logs/rotating_mt.log", file_size, rotating_files);
|
||||||
bench_mt(iters, std::move(rotating_mt), threads);
|
bench_mt(iters, std::move(rotating_mt), threads);
|
||||||
|
@ -141,7 +141,6 @@ SPDLOG_INLINE std::shared_ptr<logger> logger::clone(std::string logger_name)
|
|||||||
return cloned;
|
return cloned;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SPDLOG_INLINE void logger::sink_it_(const details::log_msg &msg)
|
SPDLOG_INLINE void logger::sink_it_(const details::log_msg &msg)
|
||||||
{
|
{
|
||||||
for (auto &sink : sinks_)
|
for (auto &sink : sinks_)
|
||||||
@ -174,7 +173,6 @@ SPDLOG_INLINE void logger::flush_()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SPDLOG_INLINE bool logger::should_flush_(const details::log_msg &msg)
|
SPDLOG_INLINE bool logger::should_flush_(const details::log_msg &msg)
|
||||||
{
|
{
|
||||||
auto flush_level = flush_level_.load(std::memory_order_relaxed);
|
auto flush_level = flush_level_.load(std::memory_order_relaxed);
|
||||||
|
@ -103,7 +103,7 @@ public:
|
|||||||
|
|
||||||
void log(log_clock::time_point log_time, source_loc loc, level::level_enum lvl, string_view_t msg)
|
void log(log_clock::time_point log_time, source_loc loc, level::level_enum lvl, string_view_t msg)
|
||||||
{
|
{
|
||||||
if(should_log(lvl))
|
if (should_log(lvl))
|
||||||
{
|
{
|
||||||
sink_it_(details::log_msg(log_time, loc, name_, lvl, msg));
|
sink_it_(details::log_msg(log_time, loc, name_, lvl, msg));
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ public:
|
|||||||
|
|
||||||
void log(source_loc loc, level::level_enum lvl, string_view_t msg)
|
void log(source_loc loc, level::level_enum lvl, string_view_t msg)
|
||||||
{
|
{
|
||||||
if(should_log(lvl))
|
if (should_log(lvl))
|
||||||
{
|
{
|
||||||
sink_it_(details::log_msg(loc, name_, lvl, msg));
|
sink_it_(details::log_msg(loc, name_, lvl, msg));
|
||||||
}
|
}
|
||||||
@ -195,8 +195,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// return true logging is enabled for the given level.
|
// return true logging is enabled for the given level.
|
||||||
[[nodiscard]]
|
[[nodiscard]] bool should_log(level::level_enum msg_level) const
|
||||||
bool should_log(level::level_enum msg_level) const
|
|
||||||
{
|
{
|
||||||
return msg_level >= level_.load(std::memory_order_relaxed);
|
return msg_level >= level_.load(std::memory_order_relaxed);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,6 @@ SPDLOG_API void set_formatter(std::unique_ptr<spdlog::formatter> formatter);
|
|||||||
// example: spdlog::set_pattern("%Y-%m-%d %H:%M:%S.%e %l : %v");
|
// example: spdlog::set_pattern("%Y-%m-%d %H:%M:%S.%e %l : %v");
|
||||||
SPDLOG_API void set_pattern(std::string pattern, pattern_time_type time_type = pattern_time_type::local);
|
SPDLOG_API void set_pattern(std::string pattern, pattern_time_type time_type = pattern_time_type::local);
|
||||||
|
|
||||||
|
|
||||||
// Get global logging level
|
// Get global logging level
|
||||||
SPDLOG_API level::level_enum get_level();
|
SPDLOG_API level::level_enum get_level();
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ set(SPDLOG_UTESTS_SOURCES
|
|||||||
test_dup_filter.cpp
|
test_dup_filter.cpp
|
||||||
test_fmt_helper.cpp
|
test_fmt_helper.cpp
|
||||||
test_stdout_api.cpp
|
test_stdout_api.cpp
|
||||||
test_create_dir.cpp
|
test_create_dir.cpp
|
||||||
test_custom_callbacks.cpp
|
test_custom_callbacks.cpp
|
||||||
test_cfg.cpp
|
test_cfg.cpp
|
||||||
test_time_point.cpp
|
test_time_point.cpp
|
||||||
|
@ -78,4 +78,3 @@ TEST_CASE("stderr_color_mt", "[stderr]")
|
|||||||
l->critical("Test stderr_color_mt");
|
l->critical("Test stderr_color_mt");
|
||||||
spdlog::drop_all();
|
spdlog::drop_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user