Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change logger to use std::format once clang supports it #31

Open
Silverlan opened this issue Jan 22, 2023 · 0 comments
Open

Change logger to use std::format once clang supports it #31

Silverlan opened this issue Jan 22, 2023 · 0 comments
Assignees
Labels
linux only affects linux version

Comments

@Silverlan
Copy link
Owner

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.

@Silverlan Silverlan self-assigned this Jan 22, 2023
@Silverlan Silverlan added the linux only affects linux version label Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linux only affects linux version
Projects
None yet
Development

No branches or pull requests

1 participant