Forum rules


Before adding a bug or feature request please check it is not already in the bug tracker or answered in the FAQ.



Change log file name format

Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Change log file name format
PostPosted: Sat Jun 09, 2007 7:41 pm 
User avatar
Burned to a crisp

Current Scorched3D Rank: Unranked





Joined: Sun Sep 03, 2006 11:08 am
Posts: 268
Location: Latvia
Just a tiny detail, but might be useful. If the date format used to construct the log file names would be YYYYMMDD instead of DDMMYYYY, finding the latest log files would be simply a matter of sorting them by name.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 14, 2007 2:44 pm 
User avatar
Burned to a crisp

Current Scorched3D Rank: Unranked





Joined: Sun Sep 03, 2006 11:08 am
Posts: 268
Location: Latvia
Here's the patch. Apply with patch -p0.

Code:
Index: ./src/common/FileLogger.cpp
===================================================================
RCS file: /cvsroot/scorched3d/scorched/src/common/FileLogger.cpp,v
retrieving revision 1.5
diff -u -r1.5 FileLogger.cpp
--- ./src/common/FileLogger.cpp   19 Feb 2007 22:18:13 -0000   1.5
+++ ./src/common/FileLogger.cpp   13 Jun 2007 13:50:23 -0000
@@ -52,7 +52,7 @@
   time_t theTime = time(0);
   struct tm *newtime = localtime(&theTime);

-   logFile_ = fopen(getLogFile(formatString("%s-%02i%02i%i-%02i%02i%02i.log", fileName,
-      newtime->tm_mday, (newtime->tm_mon + 1), (newtime->tm_year + 1900),
+   logFile_ = fopen(getLogFile(formatString("%s-%i%02i%02i-%02i%02i%02i.log", fileName,
+      newtime->tm_year + 1900, newtime->tm_mon + 1, newtime->tm_mday,
      newtime->tm_hour, newtime->tm_min, newtime->tm_sec)), "w");
}


Course, the whole point of this is that you no longer have to read the ls manual to figure out how to sort by time stamps. :P Also, the file list can be sorted chronologically at any point in the command pipe line, which I think is valuable.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 15, 2007 1:15 am 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked






Joined: Sat Jun 12, 2004 12:53 am
Posts: 2884
Location: _____________________________ Current Scorched3d Rank: 1 _____________________________ *clink*
Sounds good to me - I read this right after you posted, but my net connection has been mostly down lately.....

Any issues with committing this change anyone?

cbx
To be honest, I don't fully understand that page, but it sounds like it provides the answers you need. - Deathstryker

She doesn't stimulate me mentally or physically... I need at least one of those - Anonymous

Who wrote this crap? - G. Camp


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 15, 2007 10:39 am 
User avatar
Burned to a crisp

Current Scorched3D Rank: Unranked





Joined: Sat May 13, 2006 9:24 am
Posts: 413
This is verry useful trick. I use it for years for naming my price lists.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 15, 2007 4:18 pm 
User avatar
Obliterated

Current Scorched3D Rank: 117





Joined: Sat Nov 05, 2005 9:29 am
Posts: 1968
Location: In a Rental.
cbx550f wrote:
Sounds good to me - I read this right after you posted,
but my net connection has been mostly down lately.....

Any issues with committing this change anyone?
cbx
making
ServerLog-27999--14062007-231414.log into
ServerLog-27999--20070614-231414.log ?

might actually be handy.
with a max size of only 300k, and making a new one each time you have
to restart the server, i've been granted over 390 log-files in less than a
months time.
Scorched3D Mod-Servers
Forum
Stats
Mods-Page


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 15, 2007 6:35 pm 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
The logfile sizes are actualy larger now, can't remember how large.

I've no issues if you want to make/commit the change.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 19, 2007 2:46 am 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked






Joined: Sat Jun 12, 2004 12:53 am
Posts: 2884
Location: _____________________________ Current Scorched3d Rank: 1 _____________________________ *clink*
Added the change for v41.

cbx
To be honest, I don't fully understand that page, but it sounds like it provides the answers you need. - Deathstryker

She doesn't stimulate me mentally or physically... I need at least one of those - Anonymous

Who wrote this crap? - G. Camp


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group