aboutsummaryrefslogtreecommitdiffstats
path: root/src/OutputUHD.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/OutputUHD.cpp')
-rw-r--r--src/OutputUHD.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/OutputUHD.cpp b/src/OutputUHD.cpp
index 48ad4c7..a82550f 100644
--- a/src/OutputUHD.cpp
+++ b/src/OutputUHD.cpp
@@ -50,6 +50,12 @@ using namespace std;
typedef std::complex<float> complexf;
+std::string stringtrim(const std::string &s)
+{
+ auto wsfront = std::find_if_not(s.begin(), s.end(), [](int c){return std::isspace(c);} );
+ return std::string(wsfront, std::find_if_not(s.rbegin(), std::string::const_reverse_iterator(wsfront), [](int c){return std::isspace(c);} ).base());
+}
+
void uhd_msg_handler(uhd::msg::type_t type, const std::string &msg)
{
if (type == uhd::msg::warning) {
@@ -59,7 +65,10 @@ void uhd_msg_handler(uhd::msg::type_t type, const std::string &msg)
etiLog.level(error) << "UHD Error: " << msg;
}
else {
- etiLog.level(debug) << "UHD Message: " << msg;
+ // do not print very short U messages and such
+ if (stringtrim(msg).size() != 1) {
+ etiLog.level(debug) << "UHD Message: " << msg;
+ }
}
}