10 #include "WindowsFileIOHelpers.h"
15 std::string
static GetTimeStamp()
19 SYSTEMTIME currentTime;
20 GetSystemTime(¤tTime);
21 sprintf(buffer,
"%d-%d-%d %d:%d:%d (%d)", currentTime.wYear, currentTime.wMonth, currentTime.wDay, currentTime.wHour, currentTime.wMinute, currentTime.wSecond, GetCurrentThreadId());
23 return std::string(buffer);
32 std::string localAppDataPath;
33 std::string logsDirectory;
36 localAppDataPath = Windows::FileIOHelpers::GetLocalAppDataPath();
37 logsDirectory =
"\\Logs";
39 Windows::FileIOHelpers::MakeDirIfNotExists(localAppDataPath + logsDirectory);
42 file.open(localAppDataPath + logsDirectory +
"\\" + filename, std::iostream::app | std::iostream::out);
44 Eegeo_ASSERT(file,
"File cannot be opened!");
59 static void Log(
const std::string& data, std::ofstream& file)
61 file << GetTimeStamp();