Commit 78c833a0 authored by gabime's avatar gabime

clang-format

parent 38888ba5
......@@ -26,13 +26,11 @@
#include <windows.h>
#endif //_WIN32
#if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT)
#include <codecvt>
#include <locale>
#endif
#ifdef SPDLOG_COMPILED_LIB
#undef SPDLOG_HEADER_ONLY
#define SPDLOG_INLINE
......
......@@ -6,7 +6,6 @@
#include "spdlog/details/null_mutex.h"
#include <mutex>
namespace spdlog {
namespace details {
......
This diff is collapsed.
......@@ -346,11 +346,10 @@ protected:
void err_handler_(const std::string &msg);
};
void swap(logger& a, logger& b);
void swap(logger &a, logger &b);
} // namespace spdlog
#ifdef SPDLOG_HEADER_ONLY
#include "logger-inl.h"
#endif
......@@ -25,7 +25,7 @@ class ansicolor_sink : public sink
{
public:
using mutex_t = typename ConsoleMutex::mutex_t;
ansicolor_sink(FILE* target_file, color_mode mode);
ansicolor_sink(FILE *target_file, color_mode mode);
~ansicolor_sink() override = default;
ansicolor_sink(const ansicolor_sink &other) = delete;
......@@ -77,12 +77,11 @@ private:
void print_range_(const fmt::memory_buffer &formatted, size_t start, size_t end);
};
template<typename ConsoleMutex>
class ansicolor_stdout_sink : public ansicolor_sink<ConsoleMutex>
{
public:
explicit ansicolor_stdout_sink(color_mode mode = color_mode::automatic);
explicit ansicolor_stdout_sink(color_mode mode = color_mode::automatic);
};
template<typename ConsoleMutex>
......@@ -92,7 +91,6 @@ public:
explicit ansicolor_stderr_sink(color_mode mode = color_mode::automatic);
};
using ansicolor_stdout_sink_mt = ansicolor_stdout_sink<details::console_mutex>;
using ansicolor_stdout_sink_st = ansicolor_stdout_sink<details::console_nullmutex>;
......
......@@ -125,7 +125,6 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::print_range_(const fmt::memory_b
::WriteConsoleA(out_handle_, formatted.data() + start, size, nullptr, nullptr);
}
// wincolor_stdout_sink
template<typename ConsoleMutex>
SPDLOG_INLINE wincolor_stdout_sink<ConsoleMutex>::wincolor_stdout_sink(color_mode mode)
......@@ -138,6 +137,5 @@ SPDLOG_INLINE wincolor_stderr_sink<ConsoleMutex>::wincolor_stderr_sink(color_mod
: wincolor_sink<ConsoleMutex>(::GetStdHandle(STD_ERROR_HANDLE), mode)
{}
} // namespace sinks
} // namespace spdlog
\ No newline at end of file
......@@ -62,14 +62,14 @@ template<typename ConsoleMutex>
class wincolor_stdout_sink : public wincolor_sink<ConsoleMutex>
{
public:
explicit wincolor_stdout_sink(color_mode mode = color_mode::automatic);
explicit wincolor_stdout_sink(color_mode mode = color_mode::automatic);
};
template<typename ConsoleMutex>
class wincolor_stderr_sink : public wincolor_sink<ConsoleMutex>
{
public:
explicit wincolor_stderr_sink(color_mode mode = color_mode::automatic);
explicit wincolor_stderr_sink(color_mode mode = color_mode::automatic);
};
using wincolor_stdout_sink_mt = wincolor_stdout_sink<details::console_mutex>;
......
......@@ -264,14 +264,12 @@ static const char *test_path = "\\a\\b\\myfile.cpp";
static const char *test_path = "/a/b//myfile.cpp";
#endif
TEST_CASE("short filename formatter-1", "[pattern_formatter]")
{
spdlog::pattern_formatter formatter("%s", spdlog::pattern_time_type::local, "");
fmt::memory_buffer formatted;
std::string logger_name = "logger-name";
spdlog::source_loc source_loc{test_path , 123, "some_func()"};
spdlog::source_loc source_loc{test_path, 123, "some_func()"};
spdlog::details::log_msg msg(source_loc, "logger-name", spdlog::level::info, "Hello");
formatter.format(msg, formatted);
REQUIRE(fmt::to_string(formatted) == "myfile.cpp");
......@@ -304,9 +302,8 @@ TEST_CASE("full filename formatter", "[pattern_formatter]")
spdlog::pattern_formatter formatter("%g", spdlog::pattern_time_type::local, "");
fmt::memory_buffer formatted;
std::string logger_name = "logger-name";
spdlog::source_loc source_loc{test_path , 123, "some_func()"};
spdlog::source_loc source_loc{test_path, 123, "some_func()"};
spdlog::details::log_msg msg(source_loc, "logger-name", spdlog::level::info, "Hello");
formatter.format(msg, formatted);
REQUIRE(fmt::to_string(formatted) == test_path);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment