From 0f30ef70f08b745755fdf362e05901039434a242 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 20 Apr 2017 16:10:06 -0700 Subject: log: Moved fastpath logging to its own thread --- host/include/uhd/utils/log.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'host/include') diff --git a/host/include/uhd/utils/log.hpp b/host/include/uhd/utils/log.hpp index a27a536b1..24c7bc1c6 100644 --- a/host/include/uhd/utils/log.hpp +++ b/host/include/uhd/utils/log.hpp @@ -248,8 +248,12 @@ namespace uhd { #endif #ifndef UHD_LOG_FASTPATH_DISABLE +//! Extra-fast logging macro for when speed matters. +// No metadata is tracked. Only the message is displayed. This does not go +// through the regular backends. Mostly used for printing the UOSDL characters +// during streaming. #define UHD_LOG_FASTPATH(message) \ - std::cerr << message << std::flush; + uhd::_log::log_fastpath(message); #else #define UHD_LOG_FASTPATH(message) #endif @@ -284,7 +288,10 @@ namespace uhd { //! \cond namespace uhd{ namespace _log { - //! \internal Internal logging object (called by UHD_LOG macros) + //! Fastpath logging + void UHD_API log_fastpath(const std::string &msg); + + //! Internal logging object (called by UHD_LOG* macros) class UHD_API log { public: log( @@ -297,7 +304,7 @@ namespace uhd{ namespace _log { ~log(void); - // \internal Macro for overloading insertion operators to avoid costly + // Macro for overloading insertion operators to avoid costly // conversion of types if not logging. #define INSERTION_OVERLOAD(x) log& operator<< (x) \ { \ -- cgit v1.2.3