H-uru / Plasma

Cyan Worlds's Plasma game engine
http://h-uru.github.io/Plasma/
GNU General Public License v3.0
205 stars 80 forks source link

Logs moved to C:\log #99

Closed cwalther closed 12 years ago

cwalther commented 12 years ago

Somewhere between 53d8f4d6e3abdd7e5b828bc84e52515c63e01ea5 and a7dbe3f7ab66252375a8c48b14d6d1aa91b564bb, logs moved from C:\Users\CWalther\AppData\Local\Uru Live\Log\ to C:\log\. Was this intentional?

I suspect the cause is the following change in e2d4b12d3d6330216d02319d9d5e866ccf34d0cd (at least I seem to be able to restore the previous location by undoing it):

diff --git a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp
index 501868c..096d419 100644
--- a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp
+++ b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp
@@ -91,7 +90,8 @@ plStatusLogMgr::plStatusLogMgr()
     fDrawer = nil;
     fLastLogChangeTime = 0;

-    PathGetLogDirectory(fBasePath, arrsize(fBasePath));
+    plFileUtils::ConcatFileName(fBasePath, L"log");
+    plFileUtils::EnsureFilePathExists(fBasePath);
 }

 plStatusLogMgr::~plStatusLogMgr()

fBasePath is "" before this, so it ends up as "\log".

I don’t have time right now to figure out what the proper solution is (maybe adding a non-Windows implementation of PathGetLogDirectory()?), so I’m just bringing it up for now.

I also just noticed that all log lines in the files (not those in the in-game log viewer) appear to be truncated to their first 4 characters after the timestamp, but I don’t have time to investigate that now.

dpogue commented 12 years ago

That was not intentional. I'll take a closer look at what pnUtils Path does to get the initial directory.

cwalther commented 12 years ago

Thanks! And here’s how to fix the truncated lines, by the way, in case you haven’t done it yourself yet: cwalther/Plasma@d1b7e4e40905e0036ed9a568d352490009eaa69f

Edit: Wait, nevermind – maybe we should check if there’s enough space left in buf before strncatting an arbitrary amount on top of it…