dosgame1/util/Log.cpp

23 lines
327 B
C++

#include "Log.h"
#include <cstdarg>
Log DefaultLog("log.txt");
Log::Log(const char *path) {
fp = fopen(path, "w");
}
Log::~Log() {
fclose(fp);
}
void Log::log(const char *fmt, ...) {
va_list args;
va_start(args, fmt);
vfprintf(fp, fmt, args);
va_end(args);
fflush(fp);
}