Created
June 17, 2020 12:31
-
-
Save SupinePandora43/ebaa4329cbc648fc7d43cc27b93bd9df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simplest file logger in c++ | |
#include <fstream> | |
//#include <iostream> | |
static void LOG(char* message) { | |
//std::cout << message << std::endl; | |
std::fstream fs; | |
fs.open("log.txt", std::fstream::in | std::fstream::out | std::fstream::app); | |
fs << message; | |
fs << "\n"; | |
fs.close(); | |
} | |
static void LOG(std::string message) { | |
LOG(message.c_str()); | |
} | |
// --- | |
// slow | |
// +++ | |
// stable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment