diff options
| author | Stefan Boberg <[email protected]> | 2021-10-29 19:21:33 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-10-29 19:21:41 +0200 |
| commit | 73a5bec027b5879a9870b156d85343c8a018fe1e (patch) | |
| tree | 2be926bb314bc95bcf950b05a699c2cc96a79243 /zenserver-test/zenserver-test.cpp | |
| parent | cas: minor improvement to CasLogFile::Open error handling (diff) | |
| parent | Minor cleanup (diff) | |
| download | zen-73a5bec027b5879a9870b156d85343c8a018fe1e.tar.xz zen-73a5bec027b5879a9870b156d85343c8a018fe1e.zip | |
Merged from main
Diffstat (limited to 'zenserver-test/zenserver-test.cpp')
| -rw-r--r-- | zenserver-test/zenserver-test.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/zenserver-test/zenserver-test.cpp b/zenserver-test/zenserver-test.cpp index 7b65cdc78..1b845f0f4 100644 --- a/zenserver-test/zenserver-test.cpp +++ b/zenserver-test/zenserver-test.cpp @@ -68,6 +68,7 @@ ZEN_THIRD_PARTY_INCLUDES_END #endif using namespace fmt::literals; +using namespace std::literals; /* @@ -128,10 +129,10 @@ public: m_Headers.reserve(16); zen::ExtendableStringBuilder<256> RequestBody; - RequestBody << "GET " << Path << " HTTP/1.1\r\n"; - RequestBody << "Host: " << Server << "\r\n"; - RequestBody << "Accept: */*\r\n"; - RequestBody << "Connection: " << (m_KeepAlive ? "keep-alive" : "close") << "\r\n\r\n"; // TODO: support keep-alive + RequestBody << "GET "sv << Path << " HTTP/1.1\r\n"sv; + RequestBody << "Host: "sv << Server << "\r\n"sv; + RequestBody << "Accept: */*\r\n"sv; + RequestBody << "Connection: "sv << (m_KeepAlive ? "keep-alive"sv : "close"sv) << "\r\n\r\n"sv; // TODO: support keep-alive m_RequestBody = RequestBody; @@ -462,12 +463,12 @@ using namespace spdlog; using namespace spdlog::details; using namespace std::literals; -class full_formatter final : public spdlog::formatter +class full_test_formatter final : public spdlog::formatter { public: - full_formatter(std::string_view LogId, std::chrono::time_point<std::chrono::system_clock> Epoch) : m_Epoch(Epoch), m_LogId(LogId) {} + full_test_formatter(std::string_view LogId, std::chrono::time_point<std::chrono::system_clock> Epoch) : m_Epoch(Epoch), m_LogId(LogId) {} - virtual std::unique_ptr<formatter> clone() const override { return std::make_unique<full_formatter>(m_LogId, m_Epoch); } + virtual std::unique_ptr<formatter> clone() const override { return std::make_unique<full_test_formatter>(m_LogId, m_Epoch); } static constexpr bool UseDate = false; @@ -682,7 +683,7 @@ main(int argc, char** argv) zen::logging::InitializeLogging(); spdlog::set_level(spdlog::level::debug); - spdlog::set_formatter(std::make_unique<::logging::full_formatter>("test", std::chrono::system_clock::now())); + spdlog::set_formatter(std::make_unique<::logging::full_test_formatter>("test", std::chrono::system_clock::now())); std::filesystem::path ProgramBaseDir = std::filesystem::path(argv[0]).parent_path(); std::filesystem::path TestBaseDir = ProgramBaseDir.parent_path().parent_path() / ".test"; |