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

SPDLOG_NO_THREAD_ID documentation in tweakme.h is wrong(ish) #1486

Closed
horenmar opened this issue Mar 23, 2020 · 1 comment
Closed

SPDLOG_NO_THREAD_ID documentation in tweakme.h is wrong(ish) #1486

horenmar opened this issue Mar 23, 2020 · 1 comment

Comments

@horenmar
Copy link

The documentaton for SPDLOG_NO_THREAD_ID in tweakme.h says

///////////////////////////////////////////////////////////////////////////////
// Uncomment if thread id logging is not needed (i.e. no %t in the log pattern).
// This will prevent spdlog from querying the thread id on each log call.
//
// WARNING: If the log pattern contains thread id (i.e, %t) while this flag is
// on, the result is undefined.

However, as currently implemented, it will always have well-defined result, the thread-id will be written as 0. This is because the flag only removes code initializing the log_msg::thread_id variable to specific value, which means that it will always be initialized to 0, which is its in-class initializer.

gabime added a commit that referenced this issue Mar 24, 2020
@gabime
Copy link
Owner

gabime commented Mar 24, 2020

Thanks. Fixed.

@gabime gabime closed this as completed Mar 24, 2020
bachittle pushed a commit to bachittle/spdlog that referenced this issue Dec 22, 2022
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

2 participants