diff options
author | Tom Rondeau <trondeau@vt.edu> | 2012-06-13 13:53:45 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2012-06-13 22:05:10 -0400 |
commit | 1300d48af4752037feac4fae7c3c64187cc0a5a8 (patch) | |
tree | 03de8a90b11caac49da563b13f50103fd537929d /gnuradio-core/src/lib/runtime | |
parent | 9e299d568123f8df5188d0850311cb7f5b5e11f2 (diff) |
log: fixed gr_log to be usable in Python.
Works with log4cxx installed and not installed.
Diffstat (limited to 'gnuradio-core/src/lib/runtime')
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_log.cc | 3 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_log.h | 21 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_log.i | 6 |
3 files changed, 18 insertions, 12 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_log.cc b/gnuradio-core/src/lib/runtime/gr_log.cc index 9be3ba04fd..cbf196cf0b 100644 --- a/gnuradio-core/src/lib/runtime/gr_log.cc +++ b/gnuradio-core/src/lib/runtime/gr_log.cc @@ -41,6 +41,7 @@ #include <stdexcept> #include <algorithm> +#ifdef ENABLE_GR_LOG void logger_load_config(const std::string &config_filename) @@ -87,3 +88,5 @@ logger_set_level(LoggerPtr logger, log4cxx::LevelPtr level) { logger->setLevel(level); } + +#endif /* ENABLE_GR_LOG */ diff --git a/gnuradio-core/src/lib/runtime/gr_log.h b/gnuradio-core/src/lib/runtime/gr_log.h index e932257a32..be01da1c6e 100644 --- a/gnuradio-core/src/lib/runtime/gr_log.h +++ b/gnuradio-core/src/lib/runtime/gr_log.h @@ -39,6 +39,7 @@ #ifdef ENABLE_GR_LOG +#include <gr_core_api.h> #include <stdio.h> #include <string> #include <stdlib.h> @@ -151,7 +152,7 @@ using namespace log4cxx::helpers; * \param config_filename The configuration file. Set to "" for the * basic logger that outputs to the console. */ -void logger_load_config(const std::string &config_filename=""); +GR_CORE_API void logger_load_config(const std::string &config_filename=""); /*! * \brief Set the logger's output level. @@ -171,7 +172,7 @@ void logger_load_config(const std::string &config_filename=""); * \param logger the logger to set the level of. * \param level string to set the level to. */ -void logger_set_level(LoggerPtr logger, const std::string &level); +GR_CORE_API void logger_set_level(LoggerPtr logger, const std::string &level); /*! * \brief Set the logger's output level. @@ -179,14 +180,14 @@ void logger_set_level(LoggerPtr logger, const std::string &level); * Sets the level of the logger. This takes the actual Log4cxx::Level * data type, which can be: * - * \li Log4cxx::Level::getOff() - * \li Log4cxx::Level::getAll() - * \li Log4cxx::Level::getTrace() - * \li Log4cxx::Level::getDebug() - * \li Log4cxx::Level::getInfo() - * \li Log4cxx::Level::getWarn() - * \li Log4cxx::Level::getError() - * \li Log4cxx::Level::getFatal() + * \li log4cxx::Level::getOff() + * \li log4cxx::Level::getAll() + * \li log4cxx::Level::getTrace() + * \li log4cxx::Level::getDebug() + * \li log4cxx::Level::getInfo() + * \li log4cxx::Level::getWarn() + * \li log4cxx::Level::getError() + * \li log4cxx::Level::getFatal() * * \param logger the logger to set the level of. * \param level new logger level of type Log4cxx::Level diff --git a/gnuradio-core/src/lib/runtime/gr_log.i b/gnuradio-core/src/lib/runtime/gr_log.i index 4c9cc4f255..b0059e05f4 100644 --- a/gnuradio-core/src/lib/runtime/gr_log.i +++ b/gnuradio-core/src/lib/runtime/gr_log.i @@ -18,6 +18,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + /******************************************************************************* * * Copyright 2011 JHU APL @@ -39,7 +40,6 @@ //----------------------------------- - #ifdef ENABLE_GR_LOG %{ @@ -57,12 +57,14 @@ public: void logger_load_config(const std::string &config_filename); void logger_set_level(LoggerPtr logger, const std::string &level); +%rename(log) gr_log; + class gr_log { private: public: -// gr_log(std::string config_filename); + //gr_log(std::string config_filename); gr_log(std::string config_filename,int watchPeriodSec); void set_level(std::string name,std::string level); void trace(std::string name,std::string msg); |