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
This commit is contained in:
parent
ac50163647
commit
814007df49
@ -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;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef _INCLUDE_SOURCEMOD_CLOGGER_H_
|
||||
#define _INCLUDE_SOURCEMOD_CLOGGER_H_
|
||||
|
||||
#include "sm_globals.h"
|
||||
#include <time.h>
|
||||
#include "sourcemm_api.h"
|
||||
#include <sh_string.h>
|
||||
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user