From 814007df49a132e4455b93fd366360b9d99d184d Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 6 Jan 2007 07:53:34 +0000 Subject: [PATCH] since these two functions are implemented separately, API calls are now divided got rid of ARRAYSIZE warning --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40276 --- core/CLogger.cpp | 12 +++--------- core/CLogger.h | 3 ++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/core/CLogger.cpp b/core/CLogger.cpp index ea622002..1f98f247 100644 --- a/core/CLogger.cpp +++ b/core/CLogger.cpp @@ -71,7 +71,7 @@ void CLogger::_CloseFile() if (fp) { fseek(fp, 0, SEEK_END); - LogMessageEx(LogType_Error, "Error log file session closed."); + LogError("Error log file session closed."); fclose(fp); } m_ErrFileName.clear(); @@ -192,19 +192,13 @@ print_error: m_Active = false; } -void CLogger::LogMessageEx(LogType type, const char *vafmt, ...) +void CLogger::LogError(const char *vafmt, ...) { if (!m_Active) { return; } - if (type == LogType_Normal) - { - LogMessage(vafmt); - return; - } - time_t t; time(&t); tm *curtime = localtime(&t); @@ -266,7 +260,7 @@ void CLogger::MapChange(const char *mapname) if (m_ErrMapStart) { - LogMessageEx(LogType_Error, "Error log file session closed."); + LogError("Error log file session closed."); } m_ErrMapStart = false; } diff --git a/core/CLogger.h b/core/CLogger.h index 3c23cfc9..5d3aa3c6 100644 --- a/core/CLogger.h +++ b/core/CLogger.h @@ -1,6 +1,7 @@ #ifndef _INCLUDE_SOURCEMOD_CLOGGER_H_ #define _INCLUDE_SOURCEMOD_CLOGGER_H_ +#include "sm_globals.h" #include #include "sourcemm_api.h" #include @@ -32,7 +33,7 @@ public: void EnableLogging(); void DisableLogging(); void LogMessage(const char *msg, ...); - void LogMessageEx(LogType type, const char *msg, ...); + void LogError(const char *msg, ...); void MapChange(const char *mapname); const char *GetLogFileName(LogType type); LoggingMode GetLoggingMode();