Skip to content

Commit

Permalink
[runSofa] App name instead of empty string (#5076)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxbilger authored Oct 21, 2024
1 parent fe3ddca commit a3067a2
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions applications/projects/runSofa/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ void addGUIParameters(sofa::gui::common::ArgumentParser* argumentParser)
GUIManager::RegisterParameters(argumentParser);
}

static std::string appName { "runSofa" };

// ---------------------------------------------------------------------
// ---
// ---------------------------------------------------------------------
Expand Down Expand Up @@ -359,17 +361,17 @@ int main(int argc, char** argv)
MessageDispatcher::addHandler( new ExceptionMessageHandler() ) ;
}
else{
msg_warning("") << "Invalid argument '" << messageHandler << "' for '--formatting'";
msg_warning(appName) << "Invalid argument '" << messageHandler << "' for '--formatting'";
}
MessageDispatcher::addHandler(&MainPerComponentLoggingMessageHandler::getInstance()) ;
#ifdef TRACY_ENABLE
MessageDispatcher::addHandler(&sofa::helper::logging::MainTracyMessageHandler::getInstance());
#endif

// Output FileRepositories
msg_info("runSofa") << "PluginRepository paths = " << PluginRepository.getPathsJoined();
msg_info("runSofa") << "DataRepository paths = " << DataRepository.getPathsJoined();
msg_info("runSofa") << "GuiDataRepository paths = " << GuiDataRepository.getPathsJoined();
msg_info(appName) << "PluginRepository paths = " << PluginRepository.getPathsJoined();
msg_info(appName) << "DataRepository paths = " << DataRepository.getPathsJoined();
msg_info(appName) << "GuiDataRepository paths = " << GuiDataRepository.getPathsJoined();

// Initialise paths
BaseGUI::setConfigDirectoryPath(Utils::getSofaPathPrefix() + "/config", true);
Expand All @@ -392,22 +394,22 @@ int main(int argc, char** argv)

if (PluginRepository.findFile(configPluginPath, "", nullptr))
{
msg_info("runSofa") << "Loading automatically plugin list in " << configPluginPath;
msg_info(appName) << "Loading automatically plugin list in " << configPluginPath;
pluginManager.readFromIniFile(configPluginPath);
}
else if (PluginRepository.findFile(defaultConfigPluginPath, "", nullptr))
{
msg_info("runSofa") << "Loading automatically plugin list in " << defaultConfigPluginPath;
msg_info(appName) << "Loading automatically plugin list in " << defaultConfigPluginPath;
pluginManager.readFromIniFile(defaultConfigPluginPath);
}
else
{
msg_info("runSofa") << "No plugin list found. No plugin will be automatically loaded.";
msg_info(appName) << "No plugin list found. No plugin will be automatically loaded.";
}
}
else
{
msg_info("runSofa") << "Automatic plugin loading disabled.";
msg_info(appName) << "Automatic plugin loading disabled.";
}

sofa::core::ObjectFactory* objectFactory = sofa::core::ObjectFactory::getInstance();
Expand Down Expand Up @@ -489,7 +491,7 @@ int main(int argc, char** argv)
sofa::simulation::node::initRoot(groot.get());
if( computationTimeAtBegin )
{
msg_info("") << sofa::helper::AdvancedTimer::end("Init", groot->getTime(), groot->getDt());
msg_info(appName) << sofa::helper::AdvancedTimer::end("Init", groot->getTime(), groot->getDt());
}

//=======================================
Expand All @@ -504,9 +506,9 @@ int main(int argc, char** argv)

if (printFactory)
{
msg_info("") << "////////// FACTORY //////////" ;
msg_info(appName) << "////////// FACTORY //////////" ;
sofa::helper::printFactoryLog();
msg_info("") << "//////// END FACTORY ////////" ;
msg_info(appName) << "//////// END FACTORY ////////" ;
}

if( computationTimeSampling>0 )
Expand Down

0 comments on commit a3067a2

Please sign in to comment.