ns3-logging

27 views
Skip to first unread message

Nakul Chawla

unread,
Jul 26, 2017, 4:31:13 PM7/26/17
to ns-3-users
Hi,

I am using ns3-3.25.
I am unable to get the logging to work in ns3. 

I have my code in the below structure:

scratch/testfile.cc

src/applications/model/allFiles

In my testfile.cc I have :

int main(int argc, char * argv[])
{
    LogComponentEnable("ComponentName", LOG_LEVEL_ALL);
 }

in my src/applications/model/file.cc

NS_LOG_COMPONENT_DEFINE("ComponentName");

namespace ns3 {

TypeID
ComponentName::GetTypeId (void)
{
attributes ....

return tid;
}

function_name(){

NS_LOG_FUNCTION(this);

NS_LOG_INFO("print this value"<<value<<"\n";

}

}//namespace ends here


Can somebody help me figure why am I unable to log when I run using the below:

NS_LOG="ComponentName" ../waf --run test

Also when I run NS_LOG="print-list" ./waf ...

I get the below output:

ComponentName=0

Thanks,
Nakul

pdbarnes

unread,
Jul 27, 2017, 11:19:23 AM7/27/17
to ns-3-users
Recall logging is only available in debug builds. How did you configure waf?

Peter

Nakul Chawla

unread,
Jul 27, 2017, 1:09:53 PM7/27/17
to ns-3-...@googlegroups.com
Hi Peter,

I was able to get it to work. Yes I had the same issue.
I was trying logging in an optimized build.

Thanks,
Nakul

> On Jul 27, 2017, at 08:19, pdbarnes <pd...@mac.com> wrote:
>
> Recall logging is only available in debug builds. How did you configure waf?
>
> Peter
>
> --
> Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> ---
> You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/aVP-XQ99A-w/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
> To post to this group, send email to ns-3-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages