#include "Log.h" #include 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); }