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

MDC ignores SPDLOG_NO_TLS #3101

Open
GaryOderNichts opened this issue May 30, 2024 · 2 comments
Open

MDC ignores SPDLOG_NO_TLS #3101

GaryOderNichts opened this issue May 30, 2024 · 2 comments

Comments

@GaryOderNichts
Copy link

The in version 1.14.0 added Mapped Diagnostic Context (MDC) support ignores the SPDLOG_NO_TLS define and always creates a thread_local variable in mdc::get_context.

static mdc_map_t &get_context() {
static thread_local mdc_map_t context;
return context;
}

This breaks support for systems where thread local storage isn't available.

@AntoineMurat
Copy link

I confirm the issue; we are also affected. While it could be mitigated with a (slow) workaround that would use the tid, I believe a reasonable hotfix would be to disable MDC entirely when SPDLOG_NO_TLS is set.

@gabime
Copy link
Owner

gabime commented Sep 1, 2024

I agree. PR is welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants