From f5e60a4feaa0f4b7fd175608a95a361273e63604 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 18 Mar 2016 18:10:01 +0100 Subject: [PATCH] Changed: Init log before calling prelogInit() --- code/ryzom/client/src/client.cpp | 4 ++++ code/ryzom/client/src/init.cpp | 37 +++++++++++++++++++------------- code/ryzom/client/src/init.h | 3 +++ 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index e4a77b3c6..1e140d3cc 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -289,6 +289,10 @@ int main(int argc, char **argv) #else // TODO for Linux : splashscreen + + // initialize log + initLog(); + #endif // initialize patch manager and set the ryzom full path, before it's used diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 864451718..18c8ba022 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -796,6 +796,28 @@ static bool addRyzomIconBitmap(const std::string &directory, vector &bi } #endif +//--------------------------------------------------- +// initLog : +// Initialize the client.log file +//--------------------------------------------------- +void initLog() +{ + // Add a displayer for Debug Infos. + createDebug(); + + // Client.Log displayer + nlassert( !ErrorLog->getDisplayer("CLIENT.LOG") ); + CFileDisplayer *ClientLogDisplayer = new CFileDisplayer(getLogDirectory() + "client.log", true, "CLIENT.LOG"); + DebugLog->addDisplayer (ClientLogDisplayer); + InfoLog->addDisplayer (ClientLogDisplayer); + WarningLog->addDisplayer (ClientLogDisplayer); + ErrorLog->addDisplayer (ClientLogDisplayer); + AssertLog->addDisplayer (ClientLogDisplayer); + + // Display the client version. + nlinfo("RYZOM VERSION : %s", getDebugVersion().c_str()); +} + //--------------------------------------------------- // prelogInit : // Initialize the application before login @@ -848,21 +870,6 @@ void prelogInit() // Due to Bug #906, we disable the stl xml allocation // nlverify (xmlMemSetup (XmlFree4NeL, XmlMalloc4NeL, XmlRealloc4NeL, XmlStrdup4NeL) == 0); - // Add a displayer for Debug Infos. - createDebug(); - - // Client.Log displayer - nlassert( !ErrorLog->getDisplayer("CLIENT.LOG") ); - CFileDisplayer *ClientLogDisplayer = new CFileDisplayer(getLogDirectory() + "client.log", true, "CLIENT.LOG"); - DebugLog->addDisplayer (ClientLogDisplayer); - InfoLog->addDisplayer (ClientLogDisplayer); - WarningLog->addDisplayer (ClientLogDisplayer); - ErrorLog->addDisplayer (ClientLogDisplayer); - AssertLog->addDisplayer (ClientLogDisplayer); - - // Display the client version. - nlinfo("RYZOM VERSION : %s", getDebugVersion().c_str()); - // Init the debug memory initDebugMemory(); diff --git a/code/ryzom/client/src/init.h b/code/ryzom/client/src/init.h index cdcdfb418..f179bf13d 100644 --- a/code/ryzom/client/src/init.h +++ b/code/ryzom/client/src/init.h @@ -27,6 +27,9 @@ namespace NLMISC class IProgressCallback; } +// Initialize the log +void initLog(); + // Initialize the application before login step void prelogInit();