To import LOG.H packages in NS3 we have discussed some of the essential steps.omnet-manual.com describes Log.h, a header file in the NS-3 network simulator. This file sets up the logging system used for debugging and tracing during simulations. It features the ns3:Log class, which allows users to log messages at different levels like info, warning, and error. Users can adjust log levels, output formats, and where the logs go, helping developers gather detailed insights about simulation events and behaviors. This logging system is crucial for identifying problems, evaluating performance, and grasping how network simulations operate.
Installation of Log.h.steps are listed below.
PRE-REQUISITES:
- Fresh installation of Ubuntu 22.04 LTS:
Screenshot:
2.NS-3.35 Installation:
Screenshot:
HEADER FILE VERIFICATION:
- Locate to the ns3.35/src/core/examples folder:
Screenshot:
2.Copy the main-test-sync.cc file to scratch folder:
Next, we need to copy the main-test-sync.cc file from ns3.35/examples/energy folder to the ns3/scratch folder.
Screenshot:
Next, we need to paste the main-test-sync.cc file to the ns3/scratch folder.
Screenshot:
3.Open the Terminal:
Next, we need to launch the terminal by right clicking the mouse in the ns3 location.
Screenshot:
Screenshot:
4.NS-3.35 Configuration && Building Process:
Next, we need to configure and build the ns3 folder to make the copied files to the scratch need to store in configuration.
Command: “./waf configure && ./waf build”
Screenshot:
Screenshot:
5.Importing Log.h:
Here we imported the Log.h header file in this example program.
Screenshot:
Here we highlighted the code line that NS_LOG_COMPONENT_DEFINE class which is the part of the Log.h that we will show class file that used in this code via Core folder which represents Core module.
Screenshot:
Screenshot:
Here we will show the header file by opening log.h file to show the class imported from the Log.h in the example code.
Screenshot:
6.Executing the Example Log Program:
Then we need to run the Example Log program to view output of the program.
Command: “./waf –run main-test-sync –vis”
Screenshot:
Here we shown the output of the example Log program by using Log.h.
Screenshot: