Jump to content

[patch][5850] Gmlog With Timestamp


Guest Stige
 Share

Recommended Posts

* What features does the patch add?

Gmlog file with timestamp because it reaches a large size and I create a new file for each crash.

* For which SubVersion revision was the patch created?

Revision: 5833

* Is there a thread in the bug report section? If yes, please add a link to the thread.

No

* Who has been writing this patch? Please include either forum user names or email addresses.

Stige (me) ([email protected])

Index: src/shared/Log.cpp
===================================================================
--- src/shared/Log.cpp        (revision 5833)
+++ src/shared/Log.cpp        (working copy)
@@ -200,6 +200,14 @@
        std::string gmlogname = sConfig.GetStringDefault("GmLogFile", "");
        if(!gmlogname.empty())
        {
+                ///////////// GmlogTimeStamp ///////////////
+                if(sConfig.GetBoolDefault("GmLogTimestamp",false)) {
+                        std::string GmLogTimestamp = GetTimestampStr();
+                        GmLogTimestamp.insert(0,"_");
+                        size_t dot_pos = gmlogname.find_last_of(".");
+                        if(dot_pos!=gmlogname.npos) gmlogname.insert(dot_pos,GmLogTimestamp);
+                        else                                                gmlogname += GmLogTimestamp;
+                }
                gmLogfile = fopen((logsDir+gmlogname).c_str(), "a");
        }

Additional changes for mangosd.conf:

Index: src/mangosd/mangosd.conf.in
===================================================================
--- src/mangosd/mangosd.conf.in        (revision 5833)
+++ src/mangosd/mangosd.conf.in        (working copy)
@@ -266,6 +266,7 @@
CharLogTimestamp = 0
CharLogDump = 0
GmLogFile = ""
+GmLogTimestamp = 0
RaLogFile = ""
LogColors = ""

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use