Commit bef9072c authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - When compiled in release, log entries are now formatted using global format string

parent 5be3eb93
......@@ -126,12 +126,12 @@ void WLogger::processQueue()
if ( entry.getLogLevel() >= m_STDOUTLevel )
{
std::cout << entry.getLogString();
std::cout << entry.getLogString( m_defaultFormat );
}
if ( entry.getLogLevel() >= m_STDERRLevel )
{
std::cerr << entry.getLogString();
std::cerr << entry.getLogString( m_defaultFormat );
}
if ( entry.getLogLevel() >= m_LogFileLevel )
......
......@@ -52,7 +52,7 @@ WKernel* kernel = NULL;
WKernel::WKernel( boost::shared_ptr< WGraphicsEngine > ge, boost::shared_ptr< WGUI > gui ):
WThreadedRunner()
{
WLogger::getLogger()->addLogMessage( "Initializing Kernel", "Kernel", LL_DEBUG );
WLogger::getLogger()->addLogMessage( "Initializing Kernel", "Kernel", LL_INFO );
// init the singleton
kernel = this;
......@@ -68,7 +68,7 @@ WKernel::WKernel( boost::shared_ptr< WGraphicsEngine > ge, boost::shared_ptr< WG
WKernel::~WKernel()
{
// cleanup
WLogger::getLogger()->addLogMessage( "Shutting down Kernel", "Kernel", LL_DEBUG );
WLogger::getLogger()->addLogMessage( "Shutting down Kernel", "Kernel", LL_INFO );
}
void WKernel::init()
......@@ -115,7 +115,7 @@ boost::shared_ptr< WGUI > WKernel::getGui() const
void WKernel::finalize()
{
WLogger::getLogger()->addLogMessage( "Stopping Kernel", "Kernel", LL_DEBUG );
WLogger::getLogger()->addLogMessage( "Stopping Kernel", "Kernel", LL_INFO );
// NOTE: stopping a container erases all modules inside.
getRootContainer()->stop();
......@@ -123,7 +123,7 @@ void WKernel::finalize()
void WKernel::threadMain()
{
WLogger::getLogger()->addLogMessage( "Starting Kernel", "Kernel", LL_DEBUG );
WLogger::getLogger()->addLogMessage( "Starting Kernel", "Kernel", LL_INFO );
// wait for GUI to be initialized properly
m_gui->isInitialized().wait();
......@@ -138,7 +138,7 @@ void WKernel::threadMain()
// actually there is nothing more to do here
waitForStop();
WLogger::getLogger()->addLogMessage( "Shutting down Kernel", "Kernel", LL_DEBUG );
WLogger::getLogger()->addLogMessage( "Shutting down Kernel", "Kernel", LL_INFO );
}
bool WKernel::findAppPath()
......@@ -185,7 +185,7 @@ bool WKernel::findAppPath()
uint32_t size = sizeof( path );
if( _NSGetExecutablePath( path, &size ) == 0 )
{
WLogger::getLogger()->addLogMessage( "Executable path is " + std::string( path ), "Kernel", LL_ERROR );
WLogger::getLogger()->addLogMessage( "Executable path is " + std::string( path ), "Kernel", LL_DEBUG );
int i = strlen( path );
while( path[i] != '/' )
......@@ -194,7 +194,7 @@ bool WKernel::findAppPath()
i--;
assert( i >= 0 );
}
WLogger::getLogger()->addLogMessage( "Application path is " + std::string( path ), "Kernel", LL_ERROR );
WLogger::getLogger()->addLogMessage( "Application path is " + std::string( path ), "Kernel", LL_DEBUG );
m_AppPath = path;
std::string shaderPath( path );
......
......@@ -256,21 +256,21 @@ void WModule::threadMain()
{
try
{
WLogger::getLogger()->addLogMessage( "Starting module main method.", "Module (" + getName() + ")", LL_DEBUG );
WLogger::getLogger()->addLogMessage( "Starting module main method.", "Module (" + getName() + ")", LL_INFO );
// call main thread function
moduleMain();
}
catch( const WException& e )
{
WLogger::getLogger()->addLogMessage( "Exception. Notifying.", "Module (" + getName() + ")", LL_DEBUG );
WLogger::getLogger()->addLogMessage( "Exception. Notifying.", "Module (" + getName() + ")", LL_ERROR );
// ensure proper exception propagation
signal_error( shared_from_this(), e );
}
catch( const std::exception& e )
{
WLogger::getLogger()->addLogMessage( "Exception. Notifying.", "Module (" + getName() + ")", LL_DEBUG );
WLogger::getLogger()->addLogMessage( "Exception. Notifying.", "Module (" + getName() + ")", LL_ERROR );
// convert these exceptions to WException
WException ce = WException( e );
......
......@@ -40,7 +40,7 @@ WModuleContainer::WModuleContainer( std::string name, std::string description ):
m_name( name ),
m_description( description )
{
WLogger::getLogger()->addLogMessage( "Constructing module container." , "ModuleContainer (" + m_name + ")", LL_DEBUG );
WLogger::getLogger()->addLogMessage( "Constructing module container." , "ModuleContainer (" + m_name + ")", LL_INFO );
// initialize members
}
......@@ -51,7 +51,7 @@ WModuleContainer::~WModuleContainer()
void WModuleContainer::add( boost::shared_ptr< WModule > module, bool run )
{
WLogger::getLogger()->addLogMessage( "Adding module \"" + module->getName() + "\" to container." , "ModuleContainer (" + m_name + ")", LL_DEBUG );
WLogger::getLogger()->addLogMessage( "Adding module \"" + module->getName() + "\" to container." , "ModuleContainer (" + m_name + ")", LL_INFO );
if ( !module->isInitialized()() )
{
......@@ -79,7 +79,7 @@ void WModuleContainer::add( boost::shared_ptr< WModule > module, bool run )
lock.unlock();
module->setAssociatedContainer( shared_from_this() );
WLogger::getLogger()->addLogMessage( "Associated module \"" + module->getName() + "\" with container." , "ModuleContainer (" + m_name + ")",
LL_DEBUG );
LL_INFO );
// now module->isUsable() is true
// -> so run it
......@@ -134,14 +134,14 @@ void WModuleContainer::remove( boost::shared_ptr< WModule > module )
void WModuleContainer::stop()
{
WLogger::getLogger()->addLogMessage( "Stopping modules." , "ModuleContainer (" + m_name + ")", LL_DEBUG );
WLogger::getLogger()->addLogMessage( "Stopping modules." , "ModuleContainer (" + m_name + ")", LL_INFO );
// read lock
boost::shared_lock<boost::shared_mutex> slock = boost::shared_lock<boost::shared_mutex>( m_moduleSetLock );
for( std::set< boost::shared_ptr< WModule > >::iterator listIter = m_modules.begin(); listIter != m_modules.end(); ++listIter )
{
WLogger::getLogger()->addLogMessage( "Waiting for module \"" + ( *listIter )->getName() + "\" to finish." ,
"ModuleContainer (" + m_name + ")", LL_DEBUG );
"ModuleContainer (" + m_name + ")", LL_INFO );
( *listIter )->wait( true );
}
slock.unlock();
......
......@@ -84,7 +84,7 @@ void WModuleFactory::load()
for( std::set< boost::shared_ptr< WModule > >::iterator listIter = m_prototypes.begin(); listIter != m_prototypes.end();
++listIter )
{
WLogger::getLogger()->addLogMessage( "Loading module: \"" + ( *listIter )->getName() + "\"", "ModuleFactory", LL_DEBUG );
WLogger::getLogger()->addLogMessage( "Loading module: \"" + ( *listIter )->getName() + "\"", "ModuleFactory", LL_INFO );
// that should not happen. Names should not occur multiple times since they are unique
if ( names.count( ( *listIter )->getName() ) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment