-
-
Notifications
You must be signed in to change notification settings - Fork 258
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
Allow specifying the output stream #105
Comments
This likely wouldn't be too hard. We could just add |
Will you make this change or should I make a PR? |
By all means, be my guest. We'd need that definition, with cerr as the default, and to add that information to the readme. As well we'd need a test case for this. I'll certainly review a PR if you make it. I might mention, in the past the owner of this repo has expressed that they want as few as possible compile time options so it's possible they may reject this change. But seeing as it's fairly simple, it might not be a big issue. |
Indeed - I'd prefer a non-preprocessor way to make this work. Maybe this could be an argument to #define dbg(...) \
dbg::DebugOutput(__FILE__, __LINE__, __func__) \
.print(std::cerr, {DBG_MAP(DBG_STRINGIFY, __VA_ARGS__)}, \
{DBG_MAP(DBG_TYPE_NAME, __VA_ARGS__)}, __VA_ARGS__) as the default, but users could define their own #define my_dbg(...) \
dbg::DebugOutput(__FILE__, __LINE__, __func__) \
.print(my_stream, {DBG_MAP(DBG_STRINGIFY, __VA_ARGS__)}, \
{DBG_MAP(DBG_TYPE_NAME, __VA_ARGS__)}, __VA_ARGS__) Note: I haven't thought about this in detail. That approach might not work. |
What about a variant of
and then
? It's still a preprocessor solution but less "magical", not a compile-time option, and the users don't need to know internal details (I also haven't yet checked if this works). |
@alexeyr I like that 👍 |
Then I'll try to make a PR when I have free time. |
What about output coloring? When should it be enabled? For example, |
Good question. Maybe |
When using RapidCheck, I'd like the option to write to
RC_LOG()
instead ofstd::cerr
:The text was updated successfully, but these errors were encountered: