--
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 the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, 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.
To print the custom traces, first the related variable must be found in respective “.cc” class file.
Once the variable is found, find the method that the variable is in.
Go to the “.h” file of the same class.
If the method is private and constant, declare the following variables in the private section of the header file.
mutable std::ofstream m_mmWaveOutFile;
mutable std::string m_mmWaveOutputFilename;
Then in the “.cc” file find the ClassName::ClassName() method. Enter the following line inside the method.
m_mmWaveOutputFilename = "example.txt";
Find the ClassName::~ClassName() method and enter the folowing lines inside the method.
if(m_mmWaveOutFile.is_open())
{
m_mmWaveOutFile.close();
}
Then find again the related method in “.cc” file and type
if (!m_mmWaveOutFile.is_open ())
{
m_mmWaveOutFile.open(m_mmWaveOutputFilename.c_str());
}
Lastly, below the above codes type,