examples/third.cc
changeset 4199 761a6ee97850
parent 4028 13c1916747f2
child 4236 6ef5bba17bf9
--- a/examples/third.cc	Wed Feb 18 22:19:20 2009 -0800
+++ b/examples/third.cc	Wed Feb 18 22:32:09 2009 -0800
@@ -40,8 +40,8 @@
 int 
 main (int argc, char *argv[])
 {
-  LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
-  LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
+
+  bool verbose = true;
 
   RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8);
 
@@ -50,8 +50,16 @@
   CommandLine cmd;
   cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma);
   cmd.AddValue ("nWifi", "Number of wifi STA devices", nWifi);
+  cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose);
+
   cmd.Parse (argc,argv);
 
+  if (verbose)
+    {
+      LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO);
+      LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO);
+    }
+
   NodeContainer p2pNodes;
   p2pNodes.Create (2);