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

fix/issue-3101: fix the issue of mdc ignores SPDLOG_NO_TLS #3177

Closed
wants to merge 1 commit into from

Conversation

Allen-20180115
Copy link
Contributor

Dear Spdlog author and Spdlog maintainers,
I hope this message finds you well. I have noticed issue #3101 titled "MDC ignores SPDLOG_NO_TLS" and believe I have found a solution that might address the problem described.
I have submitted a Pull Request (PR) with the following details:
● PR Title: Brief description of the changes made.
● Commit Message: Detailed explanation of the changes, including the approach taken and any tests performed.
● Related Issue: Resolves issue #3101 by implementing the aforementioned changes.
In my PR, I have made the following changes:
● [List of changes made in the PR, e.g., "Fix the issue of mdc ignores SPDLOG_NO_TLS"].
● [Any additional changes or relevant details].

Test environment and compilation steps:
OS: Ubuntu 18.04 LTS
Architecture: x86-64
Compiler: gcc 7.5.0

Test results of the original main branch code:

I have tested the solution using the example program from the spdlog library, and it proves to work correctly. If necessary, I can provide more persuasive test results later on and believe it aligns with the project's coding standards. However, I am open to any feedback or suggestions for improvement. If there are any adjustments needed, or if further clarification is required, please let me know.
Thank you for considering my contribution. I am excited about the opportunity to contribute to Spdlog and look forward to your review.
Best regards,
[Allen/Allen-20180115]

@gabime
Copy link
Owner

gabime commented Sep 11, 2024

Thanks for the PR. I think however that the fix can be much simpler: just wrap the code inside mdc.h code with #ifndef SPDLOG_NO_TLS (and the code in the format function).

@gabime gabime closed this Sep 11, 2024
@Allen-20180115
Copy link
Contributor Author

Thanks for the PR. I think however that the fix can be much simpler: just wrap the code inside mdc.h code with #ifndef SPDLOG_NO_TLS (and the code in the format function).

I am delighted to receive your response. I agree that the modification to the function signature of get_context in the mdc.h file has a significant impact. Although it has passed simple tests and works normally, it is indeed not a good solution. After revisiting the code involving the mdc file and the compile option SPDLOG_NO_TLS in the spdlog library, and considering your perspective (which I had also thought of but not attempted), I have revised the related code and resubmitted a new PR. I hope this will be helpful in resolving the issue. Thank you!

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

Successfully merging this pull request may close these issues.

2 participants