I have two questions regarding Ogre::LogManager and Ogre::Exception, in essence I’m wondering if I should use them. Sounds silly doesn’t it ?
What is the preferred method:
Use Ogre’s Logging abilities (and sift through the log file for my information), or use a different logging method (a preexisting log class from another project for instance).
I think I would prefer to use Ogre::LogManager given that if I understand this listener business right I can eves drop and output log messages to say an in game console or the like, which is desirable, but I’d really like to log things before Ogre::Root() is created as such I’d need to manage the LogManager’s lifetime myself, i.e.:
Code: Select all
// in main() {
Ogre::LogManager * log_manager = NULL;
// Create log manager and default log file if there is no log manager yet
if ( Ogre::LogManager::getSingletonPtr() == NULL)
{
log_manager = new LogManager();
log_manager->createLog("Ogre.log", true, true);
}
// ... try{}catch{}, etc.
if ( log_manager)
{
delete log_manager;
log_manager = NULL;
}
return EXIT_SUCCESS;}
Or is there something about this that I am completely missing the point of ?
I have a similar question regarding Ogre::Exception() … Do I dare use it knowing that the help for “enum Ogre::Exception::ExceptionCodes” explicitly states: “Todo: Add many more exception codes, since we want the user to be able to catch most of them.” I.e. at what point can I add my own error values without stepping on the *possible future* additional Ogre::Exception::ExceptionCodes ? A quick bounds (i.e. “ERR_USER = 1000” in the Ogre::Exception::ExceptionCodes enum would answer this.)
Or should I be throwing my own exception class and let Ogre::Exception remain solely in the domain of Ogre?
Commentary welcome, Thank you (=
