From c936fed335eff0362514feb92ede25410848f554 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 17 Apr 2017 13:56:01 -0700 Subject: logging: UHD_HERE() now also prints current function (gcc only) --- host/include/uhd/utils/log.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'host/include') diff --git a/host/include/uhd/utils/log.hpp b/host/include/uhd/utils/log.hpp index ce6ce16e7..9cc400f7c 100644 --- a/host/include/uhd/utils/log.hpp +++ b/host/include/uhd/utils/log.hpp @@ -198,9 +198,14 @@ namespace uhd { #define UHD_LOGGER_FATAL(component) _UHD_LOG_INTERNAL(component, uhd::log::fatal) +#if defined(__GNUG__) //! Helpful debug tool to print site info +#define UHD_HERE() \ + UHD_LOGGER_DEBUG("DEBUG") << __FILE__ << ":" << __LINE__ << " (" << __PRETTY_FUNCTION__ << ")"; +#else #define UHD_HERE() \ UHD_LOGGER_DEBUG("DEBUG") << __FILE__ << ":" << __LINE__; +#endif //! Helpful debug tool to print a variable #define UHD_VAR(var) \ -- cgit v1.2.3