Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » LOG compression
LOG compression [message #39186] Mon, 25 February 2013 11:03 Go to next message
Zbych is currently offline  Zbych
Messages: 325
Registered: July 2009
Senior Member
Hi,

LOG keeps creating compressed logs regardless of LOG_ROTATE_GZIP flag. There should be additional LOG_ROTATE_GZIP flag check in Create function.

void LogOut::Create(bool append)
{
	Close();
	
	char next[512];
	for(int rot = options >> 24; rot >= 0; rot--) {
		char current[512];
		if(rot == 0)
			strcpy(current, filepath);
		else
			sprintf(current, rot > 1 && (options & LOG_ROTATE_GZIP) ? "%s.%d.gzip" : "%s.%d",
			        filepath, rot);
		if(FileExists(current)) {
			if(rot == (options >> 24))
				FileDelete(current);
			else
			if((options & LOG_ROTATE_GZIP) && rot == 1 && !IsPanicMode()) //<<<---- "(options & LOG_ROTATE_GZIP) &&" is missing
				SaveFile(next, GZCompress(LoadFile(current)));
			else
				FileMove(current, next);
		}
		strcpy(next, current);
	}
Re: LOG compression [message #39191 is a reply to message #39186] Mon, 25 February 2013 20:20 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks, fixed.

Mirek
Previous Topic: PipeStream - bidirectional Stream
Next Topic: A few bugs in Core/Rpc
Goto Forum:
  


Current Time: Thu Mar 28 16:22:12 CET 2024

Total time taken to generate the page: 0.01576 seconds