Files
Sun1602/CrashReporter/Source/Logger.h
T
2022-10-26 12:25:11 +08:00

18 lines
390 B
C++

class CLogger
{
public:
const static int MAXIMUM_TRY = 5; // maximum try to open file
CLogger();
~CLogger();
bool Open();
void Close();
bool Write(LPCTSTR szLine);
bool WriteWithFormat(LPCTSTR szFormat, ...);
private:
FILE *m_pFile; // log file pointer
CRITICAL_SECTION m_csLog; // critical section for logger
bool m_bOpen; // whether file is opened or not
};