diff options
author | Mark Plett <mark.plett@jhuapl.edu> | 2013-03-19 19:10:51 -0700 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-03-26 22:00:03 -0400 |
commit | 9bbbda510c265b211b5b571db79ba259c67ee049 (patch) | |
tree | d913beb8f63d6fd9771216e609917fe34400a5bd /docs/doxygen/other/logger.dox | |
parent | 9de095e6051a41c3b3f5a682b1a9f69551bb4f69 (diff) |
core: Made logger swig functional
Improved logger swig so gr_logger is a logger object that is configurable
Made logger config a singleton and made accessors for loggers from python
Diffstat (limited to 'docs/doxygen/other/logger.dox')
-rw-r--r-- | docs/doxygen/other/logger.dox | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/docs/doxygen/other/logger.dox b/docs/doxygen/other/logger.dox index 22458051db..f5228cfc55 100644 --- a/docs/doxygen/other/logger.dox +++ b/docs/doxygen/other/logger.dox @@ -24,8 +24,9 @@ different levels. These levels are: The order here determines the level of output. These levels are hierarchical in that specifying any level also includes any level -above it. For example, when using the WARN level, all WARN and -higher messages are logged while DEBUG and INFO are ignored. +above it. For example, when using the INFO level, all INFO and +higher messages are logged and DEBUG is ignored. A level NOTSET is provided +to disable a logger. \subsection configfile Logging Configuration @@ -143,7 +144,7 @@ provided with GNU Radio can be used. After installation, the default configuration script is located at: <pre> - $prefix/etc/gnuradio/gr_log_default.xml + $prefix/etc/gnuradio/gr_log_default.conf </pre> For the following examples, we will assume that our local @@ -151,12 +152,12 @@ For the following examples, we will assume that our local \code [LOG] -log_config = /opt/gr/etc/gnuadio/gr_log_default.xml +log_config = /opt/gr/etc/gnuadio/gr_log_default.conf log_level = debug debug_level = Off \endcode -Inside of the XML default configuration file, we define the parameters +Inside of the default configuration file, we define the parameters for the two logger's, the standard logger the separate debug logger. If the levels of the two loggers are specified in our configuration @@ -202,4 +203,24 @@ This creates a pointer called LOG (which is instantiated as a log4cpp:LoggerPtr in the macro) that we can now use locally as the input to our logging macros like 'GR_LOG_INFO(LOG, "message")'. +\section logPy Logging from Python + +The logging capability has been brought out python via swig. The configuration +of the logger can be manipulated via the following calls: +\code + from gnuradio import gr + gr.logger_config(filename,watch_period) # Configures the logger with conf file filename + names = gr.logger_get_logger_names() # Returns the names of all loggers + gr.logger_reset_config() # Resets logger config by removing all appenders +\endcode + +Once the logger is configured you can manipulate a logger via a wrapper class gr.logger(). +You can isntantiate this by the following. (Reference gr_logger.h for list of methods) +\code + from gnuradio import gr + log=gr.logger("nameOfLogger") + log.debug("Log a debug message") + log.set_level("INFO"); + +\endcode */ |