diff options
author | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-17 15:35:07 -0700 |
commit | 26b5e033ffde3d161382fc9addbfa99738379641 (patch) | |
tree | a344f369ca32945f787a02dee35c3dbe342bed7e /src/shared/Log.h | |
parent | f21f47005dcb6b76e1abc9f35fbcd03eed191bff (diff) |
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget
--HG--
branch : trunk
Diffstat (limited to 'src/shared/Log.h')
-rw-r--r-- | src/shared/Log.h | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/shared/Log.h b/src/shared/Log.h index 283b8819a10..ff6f3ad39ee 100644 --- a/src/shared/Log.h +++ b/src/shared/Log.h @@ -17,16 +17,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #ifndef TRINITYCORE_LOG_H #define TRINITYCORE_LOG_H - #include "Common.h" #include "Policies/Singleton.h" #include "Database/DatabaseEnv.h" - class Config; - enum LogFilters { LOG_FILTER_TRANSPORT_MOVES = 1, @@ -34,7 +30,6 @@ enum LogFilters LOG_FILTER_VISIBILITY_CHANGES = 4, LOG_FILTER_ACHIEVEMENT_UPDATES = 8 }; - enum LogTypes { LOG_TYPE_STRING = 0, @@ -50,7 +45,6 @@ enum LogTypes LOG_TYPE_CHAT = 10, MAX_LOG_TYPES }; - enum LogLevel { LOGL_NORMAL = 0, @@ -58,9 +52,7 @@ enum LogLevel LOGL_DETAIL, LOGL_DEBUG }; - const int LogLevels = int(LOGL_DEBUG)+1; - enum ColorTypes { BLACK, @@ -79,22 +71,17 @@ enum ColorTypes LCYAN, WHITE }; - const int Colors = int(WHITE)+1; - class Log : public Trinity::Singleton<Log, Trinity::ClassLevelLockable<Log, ACE_Thread_Mutex> > { friend class Trinity::OperatorNew<Log>; Log(); ~Log(); - public: void Initialize(); - void InitColors(const std::string& init_str); void SetColor(bool stdout_stream, ColorTypes color); void ResetColor(bool stdout_stream); - void outDB( LogTypes type, const char * str ); void outString( const char * str, ... ) ATTR_PRINTF(2,3); void outString( ); @@ -110,21 +97,17 @@ class Log : public Trinity::Singleton<Log, Trinity::ClassLevelLockable<Log, ACE_ void outCommand( uint32 account, const char * str, ...) ATTR_PRINTF(3,4); void outRemote( const char * str, ... ) ATTR_PRINTF(2,3); void outChat( const char * str, ... ) ATTR_PRINTF(2,3); - void outArena( const char * str, ... ) ATTR_PRINTF(2,3); + void outArena( const char * str, ... ) ATTR_PRINTF(2,3); void outCharDump( const char * str, uint32 account_id, uint32 guid, const char * name ); - static void outTimestamp(FILE* file); static std::string GetTimestampStr(); - void SetLogLevel(char * Level); void SetLogFileLevel(char * Level); void SetDBLogLevel(char * Level); void SetRealmID(uint32 id) { realm = id; } - uint32 getLogFilter() const { return m_logFilter; } bool IsOutDebug() const { return m_logLevel > 2 || (m_logFileLevel > 2 && logfile); } bool IsOutCharDump() const { return m_charLog_Dump; } - bool GetLogDB() { return m_enableLogDB; } bool GetLogDBLater() { return m_enableLogDBLater; } void SetLogDB(bool enable) { m_enableLogDB = enable; } @@ -132,7 +115,6 @@ class Log : public Trinity::Singleton<Log, Trinity::ClassLevelLockable<Log, ACE_ private: FILE* openLogFile(char const* configFileName,char const* configTimeStampFlag, char const* mode); FILE* openGmlogPerAccount(uint32 account); - FILE* raLogfile; FILE* logfile; FILE* gmLogfile; @@ -140,23 +122,18 @@ class Log : public Trinity::Singleton<Log, Trinity::ClassLevelLockable<Log, ACE_ FILE* dberLogfile; FILE* chatLogfile; FILE* arenaLogFile; - // cache values for after initilization use (like gm log per account case) std::string m_logsDir; std::string m_logsTimestamp; - // gm log control bool m_gmlog_per_account; std::string m_gmlog_filename_format; - bool m_enableLogDBLater; bool m_enableLogDB; uint32 realm; - // log coloring bool m_colored; ColorTypes m_colors[4]; - // log levels: // 0 minimum/string, 1 basic/error, 2 detail, 3 full/debug uint8 m_dbLogLevel; @@ -169,15 +146,12 @@ class Log : public Trinity::Singleton<Log, Trinity::ClassLevelLockable<Log, ACE_ bool m_dbChat; bool m_charLog_Dump; }; - #define sLog Trinity::Singleton<Log>::Instance() - #ifdef TRINITY_DEBUG #define DEBUG_LOG Trinity::Singleton<Log>::Instance().outDebug #else #define DEBUG_LOG #endif - // primary for script library void TRINITY_DLL_SPEC outstring_log(const char * str, ...) ATTR_PRINTF(1,2); void TRINITY_DLL_SPEC detail_log(const char * str, ...) ATTR_PRINTF(1,2); |