How to carriage return ('\r') when printing a string with an std::endl at the end of it?

75 views Asked by At

In C++, I am using spdlog to print important information for my code to help me debug it. However, I don't want a specific message to be printed every line every frame, I want it to be over-printed with the new message just like using '\r'. So the problem is I think spdlog uses '\n' or std::endl for every message it logs and I don't want that because it prevents me from using '\r' to override the printed string and print another, how can I fix this?

I tried doing std::cout << '\r'; before/after the spdlog message but it just won't work. I'm mostly sure it's because of the new-line character but have no idea how to fix it..

0

There are 0 answers