small log-filename patch

tdev

18-01-2009 23:28:34

take care that your paths can be different

Index: include/MyGUI_Gui.h
===================================================================
--- include/MyGUI_Gui.h (revision 1816)
+++ include/MyGUI_Gui.h (working copy)
@@ -36,7 +36,7 @@
@param
_group OgreResourceGroup where _core and all other config and GUI resource files are
*/
- void initialise(Ogre::RenderWindow* _window, const std::string& _core = "core.xml", const std::string & _group = Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ void initialise(Ogre::RenderWindow* _window, const std::string& _core = "core.xml", const std::string & _group = Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::String logfilename = MYGUI_LOG_FILENAME);
/** Shutdown GUI and all GUI Managers*/
void shutdown();

@@ -180,14 +180,14 @@
If widget not found or T and found widget have different types cause exception, or if the second parameter is false the null pointer will be returned
*/
template <typename T> T* findWidget(const std::string& _name, bool _throw = true)
- {
- WidgetPtr widget = findWidgetT(_name, _throw);
- if (null == widget) return null;
+ {
+ WidgetPtr widget = findWidgetT(_name, _throw);
+ if (null == widget) return null;
return widget->castType<T>(_throw);
}

Index: src/MyGUI_Gui.cpp
===================================================================
--- src/MyGUI_Gui.cpp (revision 1816)
+++ src/MyGUI_Gui.cpp (working copy)
@@ -29,10 +29,10 @@

MYGUI_INSTANCE_IMPLEMENT(Gui);

- void Gui::initialise(Ogre::RenderWindow* _window, const std::string& _core, const Ogre::String & _group)
+ void Gui::initialise(Ogre::RenderWindow* _window, const std::string& _core, const Ogre::String & _group, Ogre::String logfilename)
{
// самый первый лог
- LogManager::registerSection(MYGUI_LOG_SECTION, MYGUI_LOG_FILENAME);
+ LogManager::registerSection(MYGUI_LOG_SECTION, logfilename);

MYGUI_ASSERT(false == mIsInitialise, INSTANCE_TYPE_NAME << " initialised twice");

Altren

20-01-2009 08:46:31

Thank you, we'll add custom log file name.

tdev

20-01-2009 11:23:43

Thank you, we'll add custom log file name.
great :)
the point is the following: if you assume that your game is installed into C:\program files\<something>, then you should only write data to the users folder (C:\users\<user>\Documents\<Yourfolder>\log\mygui.log), and not anymore to the application folder(C:\program files\<something>\mygui.log)
This is due to vista's folder emulation thingy.