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

Output Stream for OutputDebugString #450

Open
shmuelie opened this issue Jun 28, 2024 · 1 comment
Open

Output Stream for OutputDebugString #450

shmuelie opened this issue Jun 28, 2024 · 1 comment
Labels
feature-request New feature or request

Comments

@shmuelie
Copy link

I feel like an output stream for OutputDebugString like https://gist.github.com/comargo/f7fe244e539325cef0f66704b58dc35a would be a very useful and logical things for WIL to have

@dunhor dunhor added the feature-request New feature or request label Jun 28, 2024
@fredemmott
Copy link

As a C++20 alternative along the lines of C++23's std::println:

template <class... Args>
void dprintln(std::format_string<Args...> format, Args&&... args) {
  const auto message = std::format(format, std::forward<Args>(args)...) + "\n";
  OutputDebugStringA(message.c_str());
}

template <class... Args>
void dprintln(std::wformat_string<Args...> format, Args&&... args) {
  const auto message = std::format(format, std::forward<Args>(args)...) + L"\n";
  OutputDebugStringW(message.c_str());
}

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

No branches or pull requests

3 participants