Improve output
authorEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Wed, 26 Oct 2016 07:59:03 +0000 (09:59 +0200)
committerEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Wed, 26 Oct 2016 07:59:03 +0000 (09:59 +0200)
example/diameter/launcher/Procedure.cpp

index 6b0fabf..fff5a91 100644 (file)
@@ -8,7 +8,7 @@
 // Standard
 #include <iostream>
 #include <string>
-#include <cstdlib>
+//#include <cstdlib>
 
 // Project
 #include <anna/core/util/Tokenizer.hpp>
@@ -69,14 +69,6 @@ void Procedure::execute(const std::string &args, std::string &response)  throw(a
   std::string ccr_t = ((tok_it != targs.end()) ? anna::Tokenizer::data(tok_it):"");
   bool haveTermination = (ccr_t != "");
 
-  //response = "\n\nInitial sequence:      "; response += seq_i; response += "\n";
-  //response += "Final sequence:        "; response += seq_f; response += "\n";
-  //response += "Sequence digits:       "; response += digits; response += "\n";
-  //response += "CCR-Initial xml:       "; response += ccr_i; response += "\n";
-  //if (haveTermination) {
-  //  response += "CCR-Termination xml:   "; response += ccr_t; response += "\n";
-  //}
-
   // Test cases cycles:
   unsigned int ll_seq_i = std::atol(seq_i.c_str());
   unsigned int ll_seq_f = std::atol(seq_f.c_str());
@@ -227,9 +219,8 @@ void Procedure::execute(const std::string &args, std::string &response)  throw(a
     sprintf(cad_aux, ndigit_format, ll_seq);
     sprintf(cad_framed, "%08x", ll_seq);
 
-    if (ll_seq % 10000 == 0) {
-      std::cout << "Processing sequence " << ll_seq << std::endl;
-    }
+    // Activity indicator:
+    if (ll_seq % 10000 == 0) std::cout << ".";
 
     sessionId.replace(left_di, i_digits, cad_aux);
     sessionId.replace(last_semicolon + left_op + 1, i_digits, cad_aux);
@@ -282,6 +273,8 @@ void Procedure::execute(const std::string &args, std::string &response)  throw(a
     }
   } // loop
 
-  response = "Programming complete !";
+  response = "Completed provision for pid "; response += anna::functions::asString(a_app->getPid()); response += "; range [";
+  response += seq_i; response += ", "; response += seq_f; response += "]; scenary: ";
+  response += "CCR-Initial"; if (haveTermination) response += " + CCR-Termination";
 }