# HG changeset patch # User Mathieu Lacage # Date 1208216366 25200 # Node ID a7e3e54c7e94dd5dde2a11970363bd452c15d23c # Parent 982a6f364d2c279c5e9d96dfacdb0fe02e9ed916 change NS_LOG= syntax and default behavior to be more useful by default. diff -r 982a6f364d2c -r a7e3e54c7e94 src/core/log.cc --- a/src/core/log.cc Mon Apr 14 12:21:24 2008 -0700 +++ b/src/core/log.cc Mon Apr 14 16:39:26 2008 -0700 @@ -67,7 +67,7 @@ std::string::size_type next = 0; while (next != std::string::npos) { - next = env.find_first_of (";", cur); + next = env.find_first_of (":", cur); std::string tmp = std::string (env, cur, next-cur); if (tmp == "print-list") { @@ -115,7 +115,7 @@ std::string::size_type next = 0; while (next != std::string::npos) { - next = env.find_first_of (";", cur); + next = env.find_first_of (":", cur); std::string tmp = std::string (env, cur, next-cur); std::string::size_type equal = tmp.find ("="); std::string component; @@ -124,7 +124,8 @@ component = tmp; if (component == myName || component == "*") { - Enable (LOG_DEBUG); + int level = LOG_ALL | LOG_PREFIX_TIME | LOG_PREFIX_FUNC; + Enable ((enum LogLevel)level); return; } } diff -r 982a6f364d2c -r a7e3e54c7e94 src/core/log.h --- a/src/core/log.h Mon Apr 14 12:21:24 2008 -0700 +++ b/src/core/log.h Mon Apr 14 16:39:26 2008 -0700 @@ -38,16 +38,16 @@ * messages, use the ns3::LogComponentEnable * function or use the NS_LOG environment variable * - * Use the environment variable NS_LOG to define a ';'-separated list of + * Use the environment variable NS_LOG to define a ':'-separated list of * logging components to enable. For example (using bash syntax), * NS_LOG="OlsrAgent" would enable one component; - * NS_LOG="OlsrAgent;Ipv4L3Protocol" would enable two - * components, etc. NS_LOG="*" will enable all available log components. - * For each component, the "debug" log level is enabled by default. + * NS_LOG="OlsrAgent:Ipv4L3Protocol" would enable two + * components, etc. NS_LOG="*" will enable all available log components at + * all levels. * * To obtain more components than just debug log level, more components * can be enabled selectively with the following - * syntax: NS_LOG='Component1=func|param|warn;Component2=error|debug' + * syntax: NS_LOG='Component1=func|param|warn:Component2=error|debug' * This example would enable the 'func', 'param', and 'warn' log * levels for 'Component1' and the 'error' and 'debug' log levels * for 'Component2'. The wildcard can be used here as well. For example