Feature Request: version logging.

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
jacmoe
Just can't stay away
Just can't stay away
Posts: 136
Joined: Sun Apr 03, 2005 14:18
Location: Holbaek, Denmark
Contact:

Feature Request: version logging.

Postby jacmoe » Fri Jul 01, 2005 14:34

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 ----

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Feature Request: version logging.

Postby CrazyEddie » Fri Jul 01, 2005 18:28

I would think someone should be able to accomodate this request ;)

User avatar
jacmoe
Just can't stay away
Just can't stay away
Posts: 136
Joined: Sun Apr 03, 2005 14:18
Location: Holbaek, Denmark
Contact:

Re: Feature Request: version logging.

Postby jacmoe » Sat Jul 02, 2005 17:12

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?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Feature Request: version logging.

Postby CrazyEddie » Sun Jul 03, 2005 09:42

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? :)

User avatar
jacmoe
Just can't stay away
Just can't stay away
Posts: 136
Joined: Sun Apr 03, 2005 14:18
Location: Holbaek, Denmark
Contact:

Re: Feature Request: version logging.

Postby jacmoe » Sun Jul 03, 2005 12:22

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. ;)

User avatar
Nitro
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Wed Jan 12, 2005 12:06

Re: Feature Request: version logging.

Postby Nitro » Wed Jul 06, 2005 01:09

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

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Feature Request: version logging.

Postby CrazyEddie » Wed Jul 06, 2005 08:18

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 :)


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests