aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-09-18 12:06:51 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-09-18 12:06:51 +0200
commitacb216d31c321da7b4e45e5ad2ff04300c98234d (patch)
tree3f10d5dd558ad2922ce2e1a650e9dd889dd81fa3 /src
parent415c6de26b164aad462c9051451cb0b324ac2ffc (diff)
downloaddabmod-acb216d31c321da7b4e45e5ad2ff04300c98234d.tar.gz
dabmod-acb216d31c321da7b4e45e5ad2ff04300c98234d.tar.bz2
dabmod-acb216d31c321da7b4e45e5ad2ff04300c98234d.zip
UHD: do not print length 1 messages
Diffstat (limited to 'src')
-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;
+ }
}
}