i am currently trying to make a very basic "logging system" and I would like to copy std::cout contents inside a std::ofstream to make a "log" file to print what i sent to the cout.
std::cout << "[LOG] My log message\n";
std::cout << "[LOG] My log message2\n";
std::ofstream s("Log.txt");
//std::cout >> s; ????????????
This is how i tried to do it but without success. I expect Log.txt to have:
[LOG] My log message
[LOG] My log message2