Raised This Month: $51 Target: $400
 12% 

[CORE] Fatal logging error


  
 
 
Thread Tools Display Modes
Author Message
-W0kk3L-
Senior Member
Join Date: May 2004
Location: Netherlands
Old 03-19-2006 , 03:10   [CORE] Fatal logging error
#1

Yesterday, i've set amxx_logging to "2", and now i'm getting the following errors:

Code:
One server (without custom plugins) is giving this:
L 03/19/2006 - 09:03:06: [AMXX] Unexpected fatal logging error. AMXX Logging disabled.
And another server (with tdm loaded) is also giving this:
Code:
L 03/19/2006 - 09:01:35: [AMXX] Unexpected fatal logging error. AMXX Logging disabled.
L 03/19/2006 - 09:01:35: [AMXX] Unexpected fatal logging error (couldn't open  for a+). AMXX Logging disabled for this map.
They don't occure with other amxx_logging variables.
Running AMX Mod X v1.70 with Metamod-P 1.19p28.
__________________
Admin @ www.crew-nexus.net -- The best dutch gaming community around -- For our servers: http://www.crew-nexus.net/servers
-W0kk3L- is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-19-2006 , 04:54  
#2

Interestingly, the code looks very confused

I'm pretty sure it used to work right; the problem is in CLog::CreateNewFile in amxxlog.cpp .

It used to loop through the possible filenames and check whether they exist; I'm afraid that this patch has broken it.

Probably someone was trying to fix this bug, but forgot to actually call the build_pathname_r function in the end ;) (the whole m_LogFile.assign call with build_pathname was replaced by a single char file[256]; which was then removed in a later commit)
__________________
hello, i am pm
PM is offline
faluco
Developer
Join Date: Mar 2005
Location: Valencia, Spain
Old 03-19-2006 , 15:12  
#3

O: hello PM
Fixed in CVS, thanks!
faluco is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-19-2006 , 15:18  
#4

Looks better, but my eyes have a suggestion:

only operate on the file variable in the loop and then assign to m_LogFile once you're done. ie.:

Code:
	char file[256];
	int i = 0;
	
	while (true)
	{
		build_pathname_r(file, sizeof(file)-1, "%s/L%02d%02d%03d.log", g_log_dir.c_str(), curTime->tm_mon + 1, curTime->tm_mday, i);
		FILE *pTmpFile = fopen(file, "r");			// open for reading to check whether the file exists
		
		if (!pTmpFile)
			break;
		
		fclose(pTmpFile);
		++i;
	}
	m_LogFile.assign(file);
If this works, it'd surely be a microsecond faster
__________________
hello, i am pm
PM is offline
faluco
Developer
Join Date: Mar 2005
Location: Valencia, Spain
Old 03-19-2006 , 15:20  
#5

indeed, i'll do that now.
faluco is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode