Filip Borčík
Filip Borčík

Reputation: 35

ns-3 logging - no logs on output

I'm trying to create new ns-3 module but somehow logs are not showing on output. I thought that it's problem with my code, so I copied first.cc and third.cc examples to the scratch dir and after running them, there was no logs too. I also tried to run them with an environment variable NS_LOG set to "*", but the output was same. When I try to print some text with std::clog or std::cout it is working but NS3 log macros are not (even NS_LOG_UNCOND).

I'm using NS version 3.31 and same problem is on Debian GNU/Linux 10 and also on Ubuntu 20.04.

How can I fix that?

Thanks, Filip

output from commands

Upvotes: 1

Views: 1243

Answers (1)

Sagar
Sagar

Reputation: 1870

It appears that you're using the optimized build. According to the Logging documentation of v3.31,

Logging statements are not compiled into optimized builds of ns-3. To use logging, one must build the (default) debug build of ns-3.

This is also the case for the latest development version of ns-3. To switch to the debug build, run

./waf configure --build-profile=debug --out=build/debug

to set the build profile, followed by ./waf to build. You can find more about the build profile in the tutorial.

Upvotes: 2

Related Questions