pragma
pragma copied to clipboard
Change logger to use std::format once clang supports it
std::format
is currently not properly supported by the clang compiler. Once it is supported, the logging system should be switched to it.
Steps:
pragma/third_party_libs/spdlog/include/spdlog/tweakme.h
:
Change
#ifdef _WIN32
#define SPDLOG_USE_STD_FORMAT
#endif
to
#define SPDLOG_USE_STD_FORMAT
pragma/CMakeLists.txt
:
Change
if(WIN32)
set(SPDLOG_USE_STD_FORMAT ON CACHE BOOL ON FORCE)
else()
set(SPDLOG_USE_STD_FORMAT OFF CACHE BOOL OFF FORCE)
endif()
to
set(SPDLOG_USE_STD_FORMAT ON CACHE BOOL ON FORCE)
pragma/core/shared/include/pragma/entities/baseentity.h
pragma/core/server/include/pragma/entities/s_baseentity.h
pragma/core/client/include/pragma/entities/c_baseentity.h
Remove #ifdef _WIN32
around the std::formatter
code blocks and #include <format>
.
pragma/core/shared/src/logging.cpp
Remove #ifdef _WIN32
around the pragma::logging::client_type
and pragma::logging::server_type
definitions and remove the #else
case.
For all instances where an entity is printed using Con::cout<<ent.print()
(or cwar,...), change it to Con::cout<<ent
.