aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-04-20 16:10:06 -0700
committerMartin Braun <martin.braun@ettus.com>2017-04-24 14:19:10 -0700
commit0f30ef70f08b745755fdf362e05901039434a242 (patch)
treed66e3c3e8c6406451560249de510fd7199a4403d /host/include
parentc4da30c0ce4d37d0f2bd9dd2883e45ed0919cd2c (diff)
downloaduhd-0f30ef70f08b745755fdf362e05901039434a242.tar.gz
uhd-0f30ef70f08b745755fdf362e05901039434a242.tar.bz2
uhd-0f30ef70f08b745755fdf362e05901039434a242.zip
log: Moved fastpath logging to its own thread
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/utils/log.hpp13
1 files changed, 10 insertions, 3 deletions
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) \
{ \