mirror of
https://github.com/gabime/spdlog.git
synced 2025-04-01 02:42:41 +08:00
clang-format
This commit is contained in:
parent
70d03fd9c3
commit
50648553cf
@ -21,7 +21,6 @@ void bench_scoped_pad(benchmark::State &state, size_t wrapped_size, spdlog::deta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void bench_formatter(benchmark::State &state, std::string pattern)
|
void bench_formatter(benchmark::State &state, std::string pattern)
|
||||||
{
|
{
|
||||||
auto formatter = spdlog::details::make_unique<spdlog::pattern_formatter>(pattern);
|
auto formatter = spdlog::details::make_unique<spdlog::pattern_formatter>(pattern);
|
||||||
@ -29,7 +28,6 @@ void bench_formatter(benchmark::State &state, std::string pattern)
|
|||||||
std::string logger_name = "logger-name";
|
std::string logger_name = "logger-name";
|
||||||
const char *text = "Hello. This is some message with length of 80 ";
|
const char *text = "Hello. This is some message with length of 80 ";
|
||||||
|
|
||||||
|
|
||||||
spdlog::details::log_msg msg(&logger_name, spdlog::level::info, text);
|
spdlog::details::log_msg msg(&logger_name, spdlog::level::info, text);
|
||||||
// formatter->format(msg, dest);
|
// formatter->format(msg, dest);
|
||||||
// printf("%s\n", fmt::to_string(dest).c_str());
|
// printf("%s\n", fmt::to_string(dest).c_str());
|
||||||
@ -60,7 +58,6 @@ void bench_formatters()
|
|||||||
benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern);
|
benchmark::RegisterBenchmark(pattern.c_str(), bench_formatter, pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// complex patterns
|
// complex patterns
|
||||||
std::vector<std::string> patterns = {
|
std::vector<std::string> patterns = {
|
||||||
"[%D %X] [%l] [%n] %v",
|
"[%D %X] [%l] [%n] %v",
|
||||||
@ -73,7 +70,6 @@ void bench_formatters()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -89,4 +85,3 @@ int main(int argc, char *argv[])
|
|||||||
benchmark::Initialize(&argc, argv);
|
benchmark::Initialize(&argc, argv);
|
||||||
benchmark::RunSpecifiedBenchmarks();
|
benchmark::RunSpecifiedBenchmarks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,7 +383,6 @@ inline int pid()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Determine if the terminal supports colors
|
// Determine if the terminal supports colors
|
||||||
// Source: https://github.com/agauniyal/rang/
|
// Source: https://github.com/agauniyal/rang/
|
||||||
inline bool is_color_terminal() SPDLOG_NOEXCEPT
|
inline bool is_color_terminal() SPDLOG_NOEXCEPT
|
||||||
|
@ -729,7 +729,8 @@ public:
|
|||||||
|
|
||||||
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
||||||
{
|
{
|
||||||
if(padinfo_.width_) {
|
if (padinfo_.width_)
|
||||||
|
{
|
||||||
scoped_pad p(msg.payload, padinfo_, dest);
|
scoped_pad p(msg.payload, padinfo_, dest);
|
||||||
fmt_helper::append_string_view(msg.payload, dest);
|
fmt_helper::append_string_view(msg.payload, dest);
|
||||||
}
|
}
|
||||||
|
@ -303,7 +303,6 @@ inline void critical(const wchar_t *fmt, const Args &... args)
|
|||||||
// SPDLOG_LEVEL_OFF
|
// SPDLOG_LEVEL_OFF
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
|
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
|
||||||
#define SPDLOG_LOGGER_TRACE(logger, ...) logger->trace(__VA_ARGS__)
|
#define SPDLOG_LOGGER_TRACE(logger, ...) logger->trace(__VA_ARGS__)
|
||||||
#define SPDLOG_TRACE(...) spdlog::trace(__VA_ARGS__)
|
#define SPDLOG_TRACE(...) spdlog::trace(__VA_ARGS__)
|
||||||
|
Loading…
Reference in New Issue
Block a user