diff options
Diffstat (limited to 'gr-uhd/lib/utils.cc')
-rw-r--r-- | gr-uhd/lib/utils.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gr-uhd/lib/utils.cc b/gr-uhd/lib/utils.cc index 5d40c4fff..da8352965 100644 --- a/gr-uhd/lib/utils.cc +++ b/gr-uhd/lib/utils.cc @@ -21,8 +21,8 @@ */ #include "utils.h" //local include +#include <uhd/utils/warning.hpp> #include <boost/format.hpp> -#include <iostream> #include <cmath> void do_samp_rate_error_message( @@ -32,11 +32,11 @@ void do_samp_rate_error_message( ){ static const double max_allowed_error = 1.0; //Sps if (std::abs(target_rate - actual_rate) > max_allowed_error){ - std::cerr << boost::format( - "Warning: The hardware does not support the requested %s sample rate:\n" - " Target sample rate: %f MSps\n" - " Actual sample rate: %f MSps\n" - ) % xx % (target_rate/1e6) % (actual_rate/1e6) << std::endl; + uhd::print_warning(str(boost::format( + "The hardware does not support the requested %s sample rate:\n" + "Target sample rate: %f MSps\n" + "Actual sample rate: %f MSps\n" + ) % xx % (target_rate/1e6) % (actual_rate/1e6))); } } @@ -47,10 +47,10 @@ void do_tune_freq_error_message( ){ static const double max_allowed_error = 1.0; //Hz if (std::abs(target_freq - actual_freq) > max_allowed_error){ - std::cerr << boost::format( - "Warning: The hardware does not support the requested %s frequency:\n" - " Target frequency: %f MHz\n" - " Actual frequency: %f MHz\n" - ) % xx % (target_freq/1e6) % (actual_freq/1e6) << std::endl; + uhd::print_warning(str(boost::format( + "The hardware does not support the requested %s frequency:\n" + "Target frequency: %f MHz\n" + "Actual frequency: %f MHz\n" + ) % xx % (target_freq/1e6) % (actual_freq/1e6))); } } |