diff --git a/examples/ipv6/fragmentation-ipv6-two-MTU.cc b/examples/ipv6/fragmentation-ipv6-two-MTU.cc index 0004a0acf..4c3975eaf 100644 --- a/examples/ipv6/fragmentation-ipv6-two-MTU.cc +++ b/examples/ipv6/fragmentation-ipv6-two-MTU.cc @@ -45,17 +45,21 @@ NS_LOG_COMPONENT_DEFINE ("FragmentationIpv6TwoMtuExample"); int main (int argc, char** argv) { -#if 0 - LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL); - LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); - LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL); -#endif + bool verbose = false; CommandLine cmd; + cmd.AddValue ("verbose", "turn on log components", verbose); cmd.Parse (argc, argv); + if (verbose) + { + LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL); + LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); + LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL); + } + NS_LOG_INFO ("Create nodes."); Ptr n0 = CreateObject (); Ptr r = CreateObject (); diff --git a/examples/ipv6/fragmentation-ipv6.cc b/examples/ipv6/fragmentation-ipv6.cc index 85c838e61..240d49a17 100644 --- a/examples/ipv6/fragmentation-ipv6.cc +++ b/examples/ipv6/fragmentation-ipv6.cc @@ -44,17 +44,21 @@ NS_LOG_COMPONENT_DEFINE ("FragmentationIpv6Example"); int main (int argc, char** argv) { -#if 0 - LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL); - LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); - LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL); -#endif + bool verbose = false; CommandLine cmd; + cmd.AddValue ("verbose", "turn on log components", verbose); cmd.Parse (argc, argv); + if (verbose) + { + LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL); + LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); + LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL); + } + NS_LOG_INFO ("Create nodes."); Ptr n0 = CreateObject (); Ptr r = CreateObject (); diff --git a/examples/ipv6/icmpv6-redirect.cc b/examples/ipv6/icmpv6-redirect.cc index 23c7888aa..3d2ecb458 100644 --- a/examples/ipv6/icmpv6-redirect.cc +++ b/examples/ipv6/icmpv6-redirect.cc @@ -55,19 +55,23 @@ NS_LOG_COMPONENT_DEFINE ("Icmpv6RedirectExample"); 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 sta1 = CreateObject (); Ptr r1 = CreateObject (); diff --git a/examples/ipv6/loose-routing-ipv6.cc b/examples/ipv6/loose-routing-ipv6.cc index b94c293e8..2597ca38d 100644 --- a/examples/ipv6/loose-routing-ipv6.cc +++ b/examples/ipv6/loose-routing-ipv6.cc @@ -50,19 +50,23 @@ NS_LOG_COMPONENT_DEFINE ("LooseRoutingIpv6Example"); int main (int argc, char **argv) { -#if 0 - LogComponentEnable ("Ipv6ExtensionLooseRouting", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6Extension", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6Interface", 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 ("Ipv6ExtensionLooseRouting", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6Extension", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); + LogComponentEnable ("NdiscCache", LOG_LEVEL_ALL); + } + NS_LOG_INFO ("Create nodes."); Ptr h0 = CreateObject (); Ptr h1 = CreateObject (); diff --git a/examples/ipv6/ping6.cc b/examples/ipv6/ping6.cc index 7e3425b17..0f76ef590 100644 --- a/examples/ipv6/ping6.cc +++ b/examples/ipv6/ping6.cc @@ -41,21 +41,25 @@ NS_LOG_COMPONENT_DEFINE ("Ping6Example"); int main (int argc, char **argv) { -#if 0 - LogComponentEnable ("Ping6Example", LOG_LEVEL_INFO); - LogComponentEnable ("Ipv6EndPointDemux", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6ListRouting", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); - LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL); - LogComponentEnable ("Ping6Application", 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 ("Ping6Example", LOG_LEVEL_INFO); + LogComponentEnable ("Ipv6EndPointDemux", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6ListRouting", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); + LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL); + LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL); + LogComponentEnable ("NdiscCache", LOG_LEVEL_ALL); + } + NS_LOG_INFO ("Create nodes."); NodeContainer n; n.Create (4); diff --git a/examples/ipv6/radvd-two-prefix.cc b/examples/ipv6/radvd-two-prefix.cc index 5caadf1b5..9815b0512 100644 --- a/examples/ipv6/radvd-two-prefix.cc +++ b/examples/ipv6/radvd-two-prefix.cc @@ -82,19 +82,23 @@ public: int main (int argc, char** argv) { -#if 0 - LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6RawSocketImpl", LOG_LEVEL_ALL); - LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); - LogComponentEnable ("RadvdApplication", LOG_LEVEL_ALL); - LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL); -#endif + bool verbose = false; CommandLine cmd; + cmd.AddValue ("verbose", "turn on log components", verbose); cmd.Parse (argc, argv); + if (verbose) + { + LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6RawSocketImpl", LOG_LEVEL_ALL); + LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); + LogComponentEnable ("RadvdApplication", LOG_LEVEL_ALL); + LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL); + } + NS_LOG_INFO ("Create nodes."); Ptr n0 = CreateObject (); Ptr r = CreateObject (); diff --git a/examples/ipv6/radvd.cc b/examples/ipv6/radvd.cc index c79f2768c..c95114414 100644 --- a/examples/ipv6/radvd.cc +++ b/examples/ipv6/radvd.cc @@ -47,19 +47,23 @@ NS_LOG_COMPONENT_DEFINE ("RadvdExample"); int main (int argc, char** argv) { -#if 0 - LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6RawSocketImpl", LOG_LEVEL_ALL); - LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL); - LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); - LogComponentEnable ("RadvdApplication", LOG_LEVEL_ALL); - LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL); -#endif + bool verbose = false; CommandLine cmd; + cmd.AddValue ("verbose", "turn on log components", verbose); cmd.Parse (argc, argv); + if (verbose) + { + LogComponentEnable ("Ipv6L3Protocol", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6RawSocketImpl", LOG_LEVEL_ALL); + LogComponentEnable ("Icmpv6L4Protocol", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6StaticRouting", LOG_LEVEL_ALL); + LogComponentEnable ("Ipv6Interface", LOG_LEVEL_ALL); + LogComponentEnable ("RadvdApplication", LOG_LEVEL_ALL); + LogComponentEnable ("Ping6Application", LOG_LEVEL_ALL); + } + NS_LOG_INFO ("Create nodes."); Ptr n0 = CreateObject (); Ptr r = CreateObject ();