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
Output to stdout instead of calling OutputDebugString
#27478
Conversation
@@ -18,5 +18,5 @@ std::wstring format(const std::wstring &txt, Args... args) { | |||
} | |||
|
|||
template <typename... Args> void log(const std::wstring &txt, Args... args) { | |||
OutputDebugString((format(txt, args...) + L"\r\n").c_str()); | |||
std::cout << (format(txt, args...) + L"\r\n").c_str(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to use cout
or would printf
be better? I don't know C++ that well, but I know some C (and Rust of course!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll be missing a #include
here (iostream iirc).
… and I feel like the redirection doesn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just added the include. It's weird how running ./mach build -d
didn't give a warning. (Oh how I miss Rust's module system...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that ./mach build -d
might not have warned me because the header may have been included in a file that already had #include <iostream>
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./mach build -d
doesn't build this code.
See https://github.com/servo/servo/wiki/Building-for-UWP
… and I feel like the redirection doesn't work.
Hmm, what do you mean? I was just implementing what @jdm suggested in #27441
I haven't investigated, but this doesn't appear to work.
☔ The latest upstream changes (presumably #29970) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing this since it changes code that has now been removed. |
Output to stdout instead of calling
OutputDebugString
since stdout redirects toOutputDebugString
anyway and also to a log file../mach build -d
does not report any errors./mach test-tidy
does not report any errorsr? @jdm