1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-06-27 06:51:34 +00:00

Add SetLevel function & Verbose log level

This commit is contained in:
Koncord 2016-08-18 07:57:11 +08:00
parent 554810fbeb
commit 1537fdbb76
2 changed files with 9 additions and 3 deletions

View file

@ -39,6 +39,11 @@ const Log &Log::Get()
return *sLog; return *sLog;
} }
void Log::SetLevel(int level)
{
sLog->logLevel = level;
}
const char* getTime() const char* getTime()
{ {
time_t t = time(0); time_t t = time(0);

View file

@ -22,14 +22,16 @@ class Log
public: public:
enum enum
{ {
LOG_INFO = 0, LOG_VERBOSE = 0,
LOG_INFO,
LOG_WARN, LOG_WARN,
LOG_ERROR, LOG_ERROR,
LOG_FATAL, LOG_FATAL
}; };
static void Create(int logLevel); static void Create(int logLevel);
static void Delete(); static void Delete();
static const Log &Get(); static const Log &Get();
static void SetLevel(int level);
void print(int level, const char *file, int line, const char *message, ...) const; void print(int level, const char *file, int line, const char *message, ...) const;
private: private:
Log(int logLevel); Log(int logLevel);
@ -39,7 +41,6 @@ class Log
Log& operator=(Log& ); Log& operator=(Log& );
static Log *sLog; static Log *sLog;
int logLevel; int logLevel;
}; };