surfxml_add_callback(ETag_surfxml_argument_cb_list, ApplicationHandler::onProcessArg);\r
surfxml_add_callback(STag_surfxml_prop_cb_list, ApplicationHandler::OnProperty);\r
surfxml_add_callback(ETag_surfxml_process_cb_list, ApplicationHandler::onEndProcess);\r
+ \r
+ // initialize the process factory used by the process handler to build the processes.\r
+ ApplicationHandler::onStartDocument();\r
\r
surf_parse_open(file);\r
\r
\r
\r
#include <Msg.hpp>\r
+#include <Host.hpp>\r
+#include <Process.hpp>\r
+\r
\r
#include <msg/msg.h>\r
#include <msg/private.h>\r
-#include <stdio.h>\r
\r
+#include <iostream>\r
+using std::cout;\r
+using std::endl;\r
+using std::streamsize;\r
+\r
+#include <iomanip>\r
+using std::setprecision;\r
+using std::setw;\r
\r
\r
\r
\r
}\r
\r
+ void info(const StringHelper& s)\r
+ {\r
+ StringHelper clock;\r
+ \r
+ cout << "[";\r
+ cout << Host::currentHost().getName();\r
+ cout << ":";\r
+ cout << Process::currentProcess().getName();\r
+ cout << ":(";\r
+ cout << Process::currentProcess().getPID();\r
+ cout << ") " ;\r
+ cout << clock.append(getClock(), "%07lf");\r
+ cout << "] [cxx4msg/INFO] ";\r
+ cout << s;\r
+ cout << endl;\r
+ }\r
+\r
void info(const char* s)\r
{\r
- //INFO1("%s",s);\r
- printf("[SimGridX/info] %s\n", s);\r
+ StringHelper clock;\r
+ \r
+ cout << "[";\r
+ cout << Host::currentHost().getName();\r
+ cout << ":";\r
+ cout << Process::currentProcess().getName();\r
+ cout << ":(";\r
+ cout << Process::currentProcess().getPID();\r
+ cout << ") " ;\r
+ cout << clock.append(getClock(), "%07lf");\r
+ cout << "] [cxx4msg/INFO] ";\r
+ cout << s;\r
+ cout << endl;\r
+ }\r
+\r
+ void error(const StringHelper& s)\r
+ {\r
+ StringHelper clock;\r
+ \r
+ cout << "[";\r
+ cout << Host::currentHost().getName();\r
+ cout << ":";\r
+ cout << Process::currentProcess().getName();\r
+ cout << ":(";\r
+ cout << Process::currentProcess().getPID();\r
+ cout << ") " ;\r
+ cout << clock.append(getClock(), "%07lf");\r
+ cout << "] [cxx4msg/ERROR] ";\r
+ cout << s;\r
+ cout << endl;\r
+ }\r
+\r
+ void error(const char* s)\r
+ {\r
+ StringHelper clock;\r
+ \r
+ cout << "[";\r
+ cout << Host::currentHost().getName();\r
+ cout << ":";\r
+ cout << Process::currentProcess().getName();\r
+ cout << ":(";\r
+ cout << Process::currentProcess().getPID();\r
+ cout << ") " ;\r
+ cout << clock.append(getClock(), "%07lf");\r
+ cout << "] [cxx4msg/ERROR] ";\r
+ cout << s;\r
+ cout << endl;\r
}\r
\r
double getClock(void)\r
#include <InvalidArgumentException.hpp>\r
#include <LogicException.hpp>\r
\r
+#include <StringHelper.hpp>\r
+\r
\r
namespace SimGrid\r
{\r
*\r
* \param s The information to display.\r
*/\r
+ SIMGRIDX_EXPORT void info(const StringHelper& s);\r
+\r
SIMGRIDX_EXPORT void info(const char* s);\r
\r
+ SIMGRIDX_EXPORT void error(const StringHelper& s);\r
+\r
+ SIMGRIDX_EXPORT void error(const char* s);\r
+\r
+\r
/*! \brief getClock() - Retrieve the simulation time\r
*\r
* \return The current simulation time.\r