This topic contains 5 replies, has 0 voices, and was last updated by  cbx550f 10 years, 4 months ago.

  • Author
    Posts
  • #5603

    parasti
    Participant

    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.

    #42823

    parasti
    Participant

    Here’s the patch. Apply with patch -p0.

    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. 😛 Also, the file list can be sorted chronologically at any point in the command pipe line, which I think is valuable.

    #42824

    cbx550f
    Participant

    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

    #42825

    naka
    Participant

    This is verry useful trick. I use it for years for naming my price lists.

    #42826

    Thrax
    Participant

    @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.

    #42827

    imported_gcamp
    Participant

    The logfile sizes are actualy larger now, can’t remember how large.

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

    #42828

    cbx550f
    Participant

    Added the change for v41.

    cbx

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.