Page 1 of 1

Feature Request: version logging.

Posted: Fri Jul 01, 2005 14:34
by jacmoe
I think it would be useful to have CEGUI log its version in the CEGUI.log - it's nice to know exactly what version you are running. ;)
It's also a great help when messing with other peoples code/stuff.

Something like this:

Code: Select all

---- CEGUI System initialisation completed ----
---- Version 0.3.0 ----

Re: Feature Request: version logging.

Posted: Fri Jul 01, 2005 18:28
by CrazyEddie
I would think someone should be able to accomodate this request ;)

Re: Feature Request: version logging.

Posted: Sat Jul 02, 2005 17:12
by jacmoe
In good old Ogre, the version is defined in OgrePrerequisites.h.

What is the equivalent of prerequisites.h in CEGUI?
Should this be in CEGUI.h or in CEGUIConfig.h ?

Code: Select all

// Define CEGUI version
#define CEGUI_VERSION_MAJOR 0
#define CEGUI_VERSION_MINOR 3
#define CEGUI_VERSION_PATCH 1


Nothing to it:

Code: Select all

std::string mVersion = PropertyHelper::uintToString(CEGUI_VERSION_MAJOR) + "." +
PropertyHelper::uintToString(CEGUI_VERSION_MINOR) + "." +
PropertyHelper::uintToString(CEGUI_VERSION_PATCH);

Logger::getSingleton().logEvent((utf8*)"---- CEGUI System initialisation completed ----");
Logger::getSingleton().logEvent((utf8*)"---- Version " + mVersion + "----");


But it raises some questions - like:
Should CEGUI::System have a mVersion member?
Could the version defines be in CEGUI.h?

Re: Feature Request: version logging.

Posted: Sun Jul 03, 2005 09:42
by CrazyEddie
Yeah, very simply done ;)

The defines should probably go in CEGUIBase.h which is generally used for all low-level stuff like that. Alternatively, a new file 'CEGUIVersion.h' which just contains those defines.

Are you going to submit a patch then? :)

Re: Feature Request: version logging.

Posted: Sun Jul 03, 2005 12:22
by jacmoe
Patch is on it's way. ;)

A CEGUIVersion.h file is added.
Is included in CEGUIBase.h.
I added a d_strVersion member to CEGUI::System.
The d_strVersion is initialised in the System constructor_impl, where it is logged upon completion of the initialisation section.

Feel free to apply the patch any way you want. ;)

Re: Feature Request: version logging.

Posted: Wed Jul 06, 2005 01:09
by Nitro
I have another feature request regarding logging: It would be cool if I could pass in my own ofstream. We run our own logging on a virtual file system and use std::streams for that. So if we could pass in an ofstream into the contructor that would get used for logging, we could redirect the CEGUI log into our own log file.

-Nitro

Re: Feature Request: version logging.

Posted: Wed Jul 06, 2005 08:18
by CrazyEddie
Custom logging has come up before. We have no objections to this, and at one stage were going to implement an abstract Logger class to allow you to interface with the system. It's just that nobody got around to doing it yet :)

@jacmoe:
Thanks for the patch btw. Should get this in soon :)