-
Notifications
You must be signed in to change notification settings - Fork 13
Standardize the use of std::cout/std::cerr for printing in C++. #287
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
base: main
Are you sure you want to change the base?
Conversation
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 would prefer the printf
/fprintf
family. Some rationale:
- it's mostly shorter compare to
std::cout
. - format string is understandable by most programmer, even those who writes Java.
- easier to substitute when we are ready for
std::print
.
But, no matter what, this really is minor. Given that you made changes already, I am fine with either way.
Yeah, Ideally I'd have prefer |
The thing is, complicated object prints are supported via Anyway, let's get this merged. ;) |
Don't worry about convert to cout/cerr to formatter print style format, you can use codex/claude to do it. to unify them, use universal logging module, ask codex/claude to change all printing and std::out std::err to universal logging module |
All the codebase uses the logger. These print are either in the examples or in the tests. Do we want to use the logger in these too? |
464d8a0
to
1698458
Compare
Related issue #311 |
8cb6ae9
to
a9847c9
Compare
Signed-off-by: rafa-be <[email protected]>
Signed-off-by: rafa-be <[email protected]>
a9847c9
to
ccdd6b7
Compare
shell: bash | ||
run: | | ||
CXX=$(which g++-14) ./scripts/build.sh | ||
./scripts/build.sh |
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.
Why do we not need CXX=$(which g++-14)
? Don't we want to keep it to pin the compiler's version?
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.
Well it works with GCC-13 now, so there is no actual need to pin it to specific compiler.
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.
But some behaviours might be different between different compiler versions. If you recall, we actually found one compiler bug for std::expected
. Since this is happening in the CI if we run into some problems again then it will be hard to debug. Is there any advantage to not pin the compiler version?
I had issues with the use of
std::print
with LLVM libc++ or with GCC 13:This standardizes the use of
iostream
s instead over the whole library.