[Solved] Singelton assert failes when calling setLogFilename
Posted: Sun Oct 24, 2010 13:42
Hi all.
I ran in to a irritating problem today. It's a simple matter of wanting to change the CEGUI log file path to my apps directory (I'm on linux and CEGUI defaults to putting it in ~/ while I have a cross platform script to resolve the resource path for my app that yields ~/.app_name on linux). I figured this should be a piece of cake (famous last words tm) and quickly found the CEGUI::Logger::getSingleton().setLogFilename() function for this purpose.
Problem is that it fails with a assert failed when I call it. I have tried to call it high and low in the initialization chain (saw a post or two that pointed out it has to be called before CEGUI::System is created) but to no avail. I noticed, however, that all the forum posts where for older versions of CEGUI (some as old as 0.2.0 ;o) and I know a lot has changed since then (initialization of System for example) and figured it might be something like that.
I have also tried to use the CEGUI::System::create() method passing it the log file as an argument. This seem to work for the log but all of a sudden my resource manager got amnesia and forgot all of my loaded resources (I use Ogres resource loader to load them and CEGUI::DefaultResourceProvider() to get that to CEGUI, worked like a charm before this) despite the fact that I send it a handle to my resource provider.
I don't mind using the System::create() route for this (I'm all for knowing and being able to affect how the system initializes) but the documentation for more advanced initialization is spotty and old for the most part (or hidden? I haven't found it ;/) ...
Any help and/or pointers appreciated on this. I'll post code if you need it but I'm thinking I must have missed something completely so I'm skipping that for now ;o)
Cheers!
I ran in to a irritating problem today. It's a simple matter of wanting to change the CEGUI log file path to my apps directory (I'm on linux and CEGUI defaults to putting it in ~/ while I have a cross platform script to resolve the resource path for my app that yields ~/.app_name on linux). I figured this should be a piece of cake (famous last words tm) and quickly found the CEGUI::Logger::getSingleton().setLogFilename() function for this purpose.
Problem is that it fails with a assert failed when I call it. I have tried to call it high and low in the initialization chain (saw a post or two that pointed out it has to be called before CEGUI::System is created) but to no avail. I noticed, however, that all the forum posts where for older versions of CEGUI (some as old as 0.2.0 ;o) and I know a lot has changed since then (initialization of System for example) and figured it might be something like that.
I have also tried to use the CEGUI::System::create() method passing it the log file as an argument. This seem to work for the log but all of a sudden my resource manager got amnesia and forgot all of my loaded resources (I use Ogres resource loader to load them and CEGUI::DefaultResourceProvider() to get that to CEGUI, worked like a charm before this) despite the fact that I send it a handle to my resource provider.
I don't mind using the System::create() route for this (I'm all for knowing and being able to affect how the system initializes) but the documentation for more advanced initialization is spotty and old for the most part (or hidden? I haven't found it ;/) ...
Any help and/or pointers appreciated on this. I'll post code if you need it but I'm thinking I must have missed something completely so I'm skipping that for now ;o)
Cheers!