added lost logfile feature

This commit is contained in:
oy 2010-08-06 20:38:13 +02:00
parent 2967c57ddc
commit 49cefa406b
5 changed files with 12 additions and 1 deletions

View file

@ -2027,6 +2027,8 @@ int main(int argc, const char **argv) // ignore_convention
// execute config file
pConsole->ExecuteFile("settings.cfg");
m_Client.Engine()->InitLogfile();
// run the client
m_Client.Run();

View file

@ -1430,6 +1430,8 @@ int main(int argc, const char **argv) // ignore_convention
if(argc > 1) // ignore_convention
pConsole->ParseArguments(argc-1, &argv[1]); // ignore_convention
pServer->Engine()->InitLogfile();
// run the server
pServer->Run();

View file

@ -9,7 +9,7 @@
MACRO_CONFIG_STR(PlayerName, player_name, 24, "nameless tee", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Name of the player")
MACRO_CONFIG_STR(ClanName, clan_name, 32, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "(not used)")
MACRO_CONFIG_STR(Password, password, 32, "", CFGFLAG_CLIENT|CFGFLAG_SERVER, "Password to the server")
MACRO_CONFIG_STR(Logfile, logfile, 128, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filename to log all output to")
MACRO_CONFIG_STR(Logfile, logfile, 128, "", CFGFLAG_SAVE|CFGFLAG_CLIENT|CFGFLAG_SERVER, "Filename to log all output to")
MACRO_CONFIG_INT(ClCpuThrottle, cl_cpu_throttle, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
MACRO_CONFIG_INT(ClEditor, cl_editor, 0, 0, 1, CFGFLAG_CLIENT, "")

View file

@ -61,6 +61,12 @@ void CEngine::Init(const char *pAppname)
//config_reset();
}
void CEngine::InitLogfile()
{
// open logfile if needed
if(g_Config.m_Logfile[0])
dbg_logger_file(g_Config.m_Logfile);
}
static int HostLookupThread(void *pUser)
{

View file

@ -17,6 +17,7 @@ class CEngine
public:
void Init(const char *pAppname);
void InitLogfile();
void HostLookup(CHostLookup *pLookup, const char *pHostname);
};