Make logger automatically put a newline (#675)

at the end of the line
remove all the newlines in log calls
This commit is contained in:
Aaron Kimbrell
2022-07-24 21:26:51 -05:00
committed by GitHub
parent a7fb6eb3f3
commit e97ae92624
86 changed files with 1249 additions and 1252 deletions

View File

@@ -44,14 +44,14 @@ void dLogger::vLog(const char* format, va_list args) {
strftime(timeStr, sizeof(timeStr), "%d-%m-%y %H:%M:%S", time);
char message[2048];
vsprintf(message, format, args);
if (m_logToConsole) {
fputs("[", stdout);
fputs(timeStr, stdout);
fputs("] ", stdout);
fputs(message, stdout);
}
if (fp != nullptr) {
fputs("[", fp);
fputs(timeStr, fp);
@@ -76,7 +76,7 @@ void dLogger::LogBasic(const std::string & message) {
void dLogger::Log(const char * className, const char * format, ...) {
va_list args;
std::string log = "[" + std::string(className) + "] " + std::string(format);
std::string log = "[" + std::string(className) + "] " + std::string(format) + "\n";
va_start(args, format);
vLog(log.c_str(), args);
va_end(args);