We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In multithreaded environment the code below outputs random hex string:
std::vector<uint8_t> data(100); LOG_DEBUG(quill::get_logger(), "data: {:02x}", fmtquill::join(data, ""));
Workaround:
std::vector<uint8_t> data(100); auto aux = fmtquill::format("{:x02}", fmtquill::join(data, "")); LOG_DEBUG(quill::get_logger(), "data: {}", aux);
Is there a better way to fix this?
The text was updated successfully, but these errors were encountered:
The problem seems to be that fmt join returns a view
view
if you try this it will fail with error 'passing views as lvalues is disallowed'
std::vector<uint8_t> data(100); auto s = fmtquill::join(data, ""); fmtquill::format("data: {:02x}", s);
The logger makes a copy of the view and then the backend thread tries to format it.
I am not sure if that can be supported. It would be good tho to fail with a static assertion when a view is passed to a LOG macro
Your workaround is good with the only drawback that the format is done on the hot thread but i dont think we have another option here
Sorry, something went wrong.
This is now disabled in compile time with 4cc4dae
As you mentioned please use the provided workaround for now
No branches or pull requests
In multithreaded environment the code below outputs random hex string:
Workaround:
Is there a better way to fix this?
The text was updated successfully, but these errors were encountered: