From 9734a74366dd095256c2e2c58c5c9bcd7547f72d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 4 May 2011 20:40:36 -0700 Subject: uhd: various tweaks to log and msg, replaced a few remaining stdio --- host/include/uhd/utils/log.hpp | 9 ++------- host/include/uhd/utils/msg.hpp | 9 ++------- host/include/uhd/utils/safe_call.hpp | 4 ++-- 3 files changed, 6 insertions(+), 16 deletions(-) (limited to 'host/include') 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 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 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 #include -#include +#include //! 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 \ ; -- cgit v1.2.3