Editing Logging

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 25: Line 25:
 
=== Logging Configuration ===
 
=== Logging Configuration ===
  
The logging configuration can be found in the '''<prefix>/etc/gnuradio/conf.d/gnuradio-runtime.conf''' file
+
The logging configuration can be found in the gnuradio-runtime.conf file
under the '''[LOG]''' section. This allows us fairly complete control over
+
under the [LOG] section. This allows us fairly complete control over
 
the logging facilities. The main configuration functions are to set up
 
the logging facilities. The main configuration functions are to set up
 
the level of the loggers and set the default output behavior of the
 
the level of the loggers and set the default output behavior of the
Line 135: Line 135:
  
 
Inside of the default configuration file, we define the parameters
 
Inside of the default configuration file, we define the parameters
for the two loggers, the standard logger and the separate debug logger.
+
for the two logger's, the standard logger the separate debug logger.
  
 
If the levels of the two loggers are specified in our configuration
 
If the levels of the two loggers are specified in our configuration
 
file, as in the above example, these levels override any levels
 
file, as in the above example, these levels override any levels
specified in the log_config file. Here, we have turned on the standard logger
+
specified in the XML file. Here, we have turned on the standard logger
 
(d_logger) to all levels and turned off the debug logger
 
(d_logger) to all levels and turned off the debug logger
 
(d_debug_logger). So even if the debug logger is used in the code, it
 
(d_debug_logger). So even if the debug logger is used in the code, it
Line 146: Line 146:
 
turned this value to the lowest level "debug."
 
turned this value to the lowest level "debug."
  
If both an log_config configuration file is set and the "log_file" or
+
If both an XML configuration file is set and the "log_file" or
 
"debug_file" options are set at the same time, both systems are
 
"debug_file" options are set at the same time, both systems are
 
actually used. So you can configure file access and the pattern
 
actually used. So you can configure file access and the pattern
through the log_config file while also still outputting to stdout or stderr.
+
through the XML file while also still outputting to stdout or stderr.
  
 
== Advanced Usage ==
 
== Advanced Usage ==
Line 155: Line 155:
 
The description above for using the logging facilities is specific to
 
The description above for using the logging facilities is specific to
 
GNU Radio blocks. We have put the code necessary to access the
 
GNU Radio blocks. We have put the code necessary to access the
logger into the gr_block parent class to simplify access and make
+
debugger into the gr_block parent class to simplify access and make
 
sure all blocks have the ability to quickly and easily use the logger.
 
sure all blocks have the ability to quickly and easily use the logger.
  
Line 217: Line 217:
 
== Logging from Python ==
 
== Logging from Python ==
  
The logging capability has been brought out python via swig (<=v3.8) or pybind11 (>=v3.9). The configuration
+
The logging capability has been brought out python via swig. The configuration
 
of the logger can be manipulated via the following calls:
 
of the logger can be manipulated via the following calls:
  
Line 226: Line 226:
  
 
Once the logger is configured you can manipulate a logger via a wrapper class gr.logger().
 
Once the logger is configured you can manipulate a logger via a wrapper class gr.logger().
You can instantiate this by the following.  (Reference logger.h for list of methods)
+
You can isntantiate this by the following.  (Reference logger.h for list of methods)
  
 
  from gnuradio import gr
 
  from gnuradio import gr

Please note that all contributions to GNU Radio are considered to be released under the Creative Commons Attribution-ShareAlike (see GNU Radio:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)