51 lines
711 B
C++
51 lines
711 B
C++
|
|
|
|
#pragma once
|
|
|
|
#ifdef _DEV
|
|
#define SLOG_LEVEL 1
|
|
#else
|
|
#define SLOG_LEVEL 0
|
|
#endif
|
|
|
|
#ifdef _DEV
|
|
char *GetLOGFILE_NAME();
|
|
#define LOGFILE_NAME GetLOGFILE_NAME()
|
|
#else
|
|
#define LOGFILE_NAME "rappelz.log"
|
|
#endif
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class SLog
|
|
{
|
|
public:
|
|
enum LOGLEVEL
|
|
{
|
|
LOGLEVEL_SYSTEM = 0,
|
|
LOGLEVEL_DEBUG = 1,
|
|
};
|
|
|
|
SLog();
|
|
~SLog();
|
|
|
|
void LogStart();
|
|
void Log( const char * pLogStr, ... );
|
|
void DebugLog( const char * pLogStr, ... );
|
|
std::string GetTimeStamp();
|
|
void OutputFile(const char* fileName);
|
|
|
|
protected:
|
|
|
|
std::vector<std::string> m_LogList;
|
|
std::vector<LOGLEVEL> m_LogLevelList;
|
|
};
|
|
|
|
SLog & GetLog();
|
|
|
|
#define SLOG GetLog().Log
|
|
#define SDEBUGLOG GetLog().DebugLog
|
|
|
|
|