changed the API around a bit to be more flexible

removed some ghastly unneeded stuff from the Translator
added Logger::LogFatal, experimental

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40669
This commit is contained in:
David Anderson
2007-04-05 05:25:11 +00:00
parent 3b9c8e1410
commit f93711bd82
11 changed files with 179 additions and 102 deletions
+12 -4
View File
@@ -36,18 +36,27 @@ enum LoggingMode
class Logger : public SMGlobalClass
{
public:
Logger() : m_Mode(LoggingMode_Daily), m_ErrMapStart(false), m_Active(false), m_DelayedStart(false), m_DailyPrintHdr(false), m_InitialState(true), m_FirstPass(true) {}
Logger() : m_Mode(LoggingMode_Daily), m_ErrMapStart(false),
m_Active(false), m_DelayedStart(false), m_DailyPrintHdr(false),
m_InitialState(true)
{
}
public: //SMGlobalClass
CoreConfigErr OnSourceModConfigChanged(const char *option, const char *value);
ConfigResult OnSourceModConfigChanged(const char *key,
const char *value,
ConfigSource source,
char *error,
size_t maxlength);
void OnSourceModStartup(bool late);
void OnSourceModAllShutdown();
public:
void InitLogger(LoggingMode mode, bool startlogging);
void InitLogger(LoggingMode mode);
void CloseLogger();
void EnableLogging();
void DisableLogging();
void LogMessage(const char *msg, ...);
void LogError(const char *msg, ...);
void LogFatal(const char *msg, ...);
void MapChange(const char *mapname);
const char *GetLogFileName(LogType type) const;
LoggingMode GetLoggingMode() const;
@@ -66,7 +75,6 @@ private:
bool m_DelayedStart;
bool m_DailyPrintHdr;
bool m_InitialState;
bool m_FirstPass;
};
extern Logger g_Logger;