Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Replace usage of "printf" by a logger.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 2 Jul 2019 12:42:00 +0000 (14:42 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 2 Jul 2019 14:12:21 +0000 (16:12 +0200)
src/smpi/smpi_replay_main.cpp

index 2404541..f12a751 100644 (file)
@@ -4,16 +4,18 @@
 #include "xbt/replay.hpp"
 #include "xbt/str.h"
 
 #include "xbt/replay.hpp"
 #include "xbt/str.h"
 
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_replay);
+
 int main(int argc, char* argv[])
 {
   if (simgrid::s4u::Actor::self() == nullptr) {
 int main(int argc, char* argv[])
 {
   if (simgrid::s4u::Actor::self() == nullptr) {
-    printf("smpireplaymain should not be called directly. Please use smpirun -replay instead.\n");
+    XBT_ERROR("smpireplaymain should not be called directly. Please use smpirun -replay instead.");
     return 1;
   }
 
   auto properties = simgrid::s4u::Actor::self()->get_properties();
   if (properties->find("smpi_replay") == properties->end()) {
     return 1;
   }
 
   auto properties = simgrid::s4u::Actor::self()->get_properties();
   if (properties->find("smpi_replay") == properties->end()) {
-    printf("invalid smpireplaymain execution. Please use smpirun -replay instead.\n");
+    XBT_ERROR("invalid smpireplaymain execution. Please use smpirun -replay instead.");
     return 1;
   }
 
     return 1;
   }