aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2013-08-23 11:19:06 -0700
committerJosh Blum <josh@joshknows.com>2013-08-23 11:19:06 -0700
commit19a438e0432567392260b3c955387659b4b03b35 (patch)
treefffb1441c874972451cceca32af00a5e72a67cb5
parent6de009cc792966595d18737ed9d3658734fc801e (diff)
downloaduhd-19a438e0432567392260b3c955387659b4b03b35.tar.gz
uhd-19a438e0432567392260b3c955387659b4b03b35.tar.bz2
uhd-19a438e0432567392260b3c955387659b4b03b35.zip
uhd: added UHD_HEX helpful print macro
-rw-r--r--host/include/uhd/utils/msg.hpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/host/include/uhd/utils/msg.hpp b/host/include/uhd/utils/msg.hpp
index 3aac9577a..2cc5893e7 100644
--- a/host/include/uhd/utils/msg.hpp
+++ b/host/include/uhd/utils/msg.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011 Ettus Research LLC
+// Copyright 2011-2013 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@
#include <uhd/config.hpp>
#include <uhd/utils/pimpl.hpp>
#include <ostream>
+#include <iomanip>
#include <string>
/*!
@@ -38,6 +39,10 @@
#define UHD_VAR(var) \
UHD_MSG(status) << #var << " = " << var << std::endl;
+//! Helpful debug tool to print a variable in hex
+#define UHD_HEX(var) \
+ UHD_MSG(status) << #var << " = 0x" << std::hex << std::setfill('0') << std::setw(8) << var << std::dec << std::endl;
+
namespace uhd{ namespace msg{
//! Possible message types