diff options
author | Josh Blum <josh@joshknows.com> | 2011-05-04 20:40:36 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-05-04 20:40:36 -0700 |
commit | 9734a74366dd095256c2e2c58c5c9bcd7547f72d (patch) | |
tree | 34b169cd39dab8809937b6fc98eb57364521e61a /host/include | |
parent | 09be0518cee887878f3b070adea25eccc4c06e60 (diff) | |
download | uhd-9734a74366dd095256c2e2c58c5c9bcd7547f72d.tar.gz uhd-9734a74366dd095256c2e2c58c5c9bcd7547f72d.tar.bz2 uhd-9734a74366dd095256c2e2c58c5c9bcd7547f72d.zip |
uhd: various tweaks to log and msg, replaced a few remaining stdio
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/utils/log.hpp | 9 | ||||
-rw-r--r-- | host/include/uhd/utils/msg.hpp | 9 | ||||
-rw-r--r-- | host/include/uhd/utils/safe_call.hpp | 4 |
3 files changed, 6 insertions, 16 deletions
diff --git a/host/include/uhd/utils/log.hpp b/host/include/uhd/utils/log.hpp index 666dfa982..8d8f42fd0 100644 --- a/host/include/uhd/utils/log.hpp +++ b/host/include/uhd/utils/log.hpp @@ -54,7 +54,7 @@ * Usage: UHD_LOGV(very_rarely) << "the log message" << std::endl; */ #define UHD_LOGV(verbosity) \ - uhd::_log::log(uhd::_log::verbosity, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) + uhd::_log::log(uhd::_log::verbosity, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)() /*! * A UHD logger macro with default verbosity. @@ -85,12 +85,7 @@ namespace uhd{ namespace _log{ const std::string &function ); ~log(void); - - std::ostream &get(void); - - template <typename T> std::ostream &operator<<(const T &x){ - return get() << x; - } + std::ostream &operator()(void); }; }} //namespace uhd::_log diff --git a/host/include/uhd/utils/msg.hpp b/host/include/uhd/utils/msg.hpp index 2313215bf..17179f551 100644 --- a/host/include/uhd/utils/msg.hpp +++ b/host/include/uhd/utils/msg.hpp @@ -27,7 +27,7 @@ * Usage: UHD_MSG(warning) << "some warning message" << std::endl; */ #define UHD_MSG(type) \ - uhd::msg::_msg(uhd::msg::type) + uhd::msg::_msg(uhd::msg::type)() namespace uhd{ namespace msg{ @@ -55,12 +55,7 @@ namespace uhd{ namespace msg{ struct UHD_API_FUTURE _msg{ _msg(const type_t type); ~_msg(void); - - std::ostream &get(void); - - template <typename T> std::ostream &operator<<(const T &x){ - return get() << x; - } + std::ostream &operator()(void); }; }} //namespace uhd::msg diff --git a/host/include/uhd/utils/safe_call.hpp b/host/include/uhd/utils/safe_call.hpp index b9f545b23..ab287cc66 100644 --- a/host/include/uhd/utils/safe_call.hpp +++ b/host/include/uhd/utils/safe_call.hpp @@ -20,10 +20,10 @@ #include <uhd/config.hpp> #include <uhd/exception.hpp> -#include <uhd/utils/msg.hpp> +#include <uhd/utils/log.hpp> //! helper macro for safe call to produce warnings -#define _UHD_SAFE_CALL_WARNING(code, what) UHD_MSG(warning) << \ +#define _UHD_SAFE_CALL_WARNING(code, what) UHD_LOGV(rarely) << \ UHD_THROW_SITE_INFO("Exception caught in safe-call.") + #code + " -> " + what \ ; |