I'm experimenting with fmt and I do get output from code below
#include <fmt/color.h>
int main() {
fmt::print(fg(fmt::color::crimson) | fmt::emphasis::bold,
"Hello, {}!\n", "world");
fmt::print(fg(fmt::color::floral_white) | bg(fmt::color::slate_gray) |
fmt::emphasis::underline, "Hello, {}!\n", "???");
fmt::print(fg(fmt::color::steel_blue) | fmt::emphasis::italic,
"Hello, {}!\n", "??");
}
However it seems to happen after program exits. If I step over each line in debug mode there is no output?
Perhaps it should flush?
I tried fflush(stdout);
unsuccessfuly.
The following seems to help. With it I get the prints with sleep in the middle. However still no print during debug while stepping in each line.
setbuf(stdout, NULL);
https://thomas.trocha.com/blog/qt-creator--make-stdout-work-in-application-output-view/
int main() {
setbuf(stdout, NULL);
fmt::print(fg(fmt::color::crimson) | fmt::emphasis::bold,
"Hello, {}!\n", "world");
qDebug() << "1";
QThread::msleep(2000);
qDebug() << "2";
fmt::print(fg(fmt::color::floral_white) | bg(fmt::color::slate_gray) |
fmt::emphasis::underline, "Hello, {}!\n", "???");
QThread::msleep(2000);
fmt::print(fg(fmt::color::steel_blue) | fmt::emphasis::italic,
"Hello, {}!\n", "??");
}