gabime / spdlog

Fast C++ logging library.
Other
24.39k stars 4.55k forks source link

Disable MDC if `SPDLOG_NO_TLS` is defined #3182

Closed GaryOderNichts closed 2 months ago

GaryOderNichts commented 2 months ago

This resolves the issue I mentioned in #3101. I added an error to mdc.h for anyone trying to include mdc if SPDLOG_NO_TLS is defined, if you prefer making the mdc:: functions no-ops or putting the class itself behind a ifndef let me know. If SPDLOG_NO_TLS is defined the & flag is treated as an unknown flag, if you prefer just ignoring it or something similar, let me know. I successfully tested these changes on a platform without TLS support with SPDLOG_NO_TLS defined.