examples/ipv6/icmpv6-redirect.cc
changeset 10136 71b625bfe8c7
parent 10135 21bdad9520b8
--- a/examples/ipv6/icmpv6-redirect.cc	Tue Aug 13 17:56:25 2013 +0200
+++ b/examples/ipv6/icmpv6-redirect.cc	Tue Aug 13 17:56:01 2013 +0200
@@ -55,19 +55,23 @@
 
 int main (int argc, char **argv)
 {
-#if 0 
-  LogComponentEnable ("Icmpv6RedirectExample", LOG_LEVEL_INFO);
-  LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_INFO);
-  LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL);
-  LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL);
-  LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL);
-  LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL);
-  LogComponentEnable ("NdiscCache", LOG_LEVEL_ALL);
-#endif
+  bool verbose = false;
 
   CommandLine cmd;
+  cmd.AddValue ("verbose", "turn on log components", verbose);
   cmd.Parse (argc, argv);
 
+  if (verbose)
+    {
+      LogComponentEnable ("Icmpv6RedirectExample", LOG_LEVEL_INFO);
+      LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_INFO);
+      LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL);
+      LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL);
+      LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL);
+      LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL);
+      LogComponentEnable ("NdiscCache", LOG_LEVEL_ALL);
+    }
+
   NS_LOG_INFO ("Create nodes.");
   Ptr<Node> sta1 = CreateObject<Node> ();
   Ptr<Node> r1 = CreateObject<Node> ();