From 1537fdbb7629842ccbd00bbe7b0ddb8ab783d157 Mon Sep 17 00:00:00 2001 From: Koncord Date: Thu, 18 Aug 2016 07:57:11 +0800 Subject: [PATCH] Add SetLevel function & Verbose log level --- components/openmw-mp/Log.cpp | 5 +++++ components/openmw-mp/Log.hpp | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/components/openmw-mp/Log.cpp b/components/openmw-mp/Log.cpp index 1b48e8056..6275b8864 100644 --- a/components/openmw-mp/Log.cpp +++ b/components/openmw-mp/Log.cpp @@ -39,6 +39,11 @@ const Log &Log::Get() return *sLog; } +void Log::SetLevel(int level) +{ + sLog->logLevel = level; +} + const char* getTime() { time_t t = time(0); diff --git a/components/openmw-mp/Log.hpp b/components/openmw-mp/Log.hpp index e96cb1764..6cd9ffef2 100644 --- a/components/openmw-mp/Log.hpp +++ b/components/openmw-mp/Log.hpp @@ -22,14 +22,16 @@ class Log public: enum { - LOG_INFO = 0, + LOG_VERBOSE = 0, + LOG_INFO, LOG_WARN, LOG_ERROR, - LOG_FATAL, + LOG_FATAL }; static void Create(int logLevel); static void Delete(); static const Log &Get(); + static void SetLevel(int level); void print(int level, const char *file, int line, const char *message, ...) const; private: Log(int logLevel); @@ -39,7 +41,6 @@ class Log Log& operator=(Log& ); static Log *sLog; int logLevel; - };