summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/realtime_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-runtime/lib/realtime_impl.cc')
-rw-r--r--gnuradio-runtime/lib/realtime_impl.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/gnuradio-runtime/lib/realtime_impl.cc b/gnuradio-runtime/lib/realtime_impl.cc
index 573e46e05b..24e9c0d034 100644
--- a/gnuradio-runtime/lib/realtime_impl.cc
+++ b/gnuradio-runtime/lib/realtime_impl.cc
@@ -12,6 +12,8 @@
#include <config.h>
#endif
+#include <gnuradio/logger.h>
+#include <gnuradio/prefs.h>
#include <gnuradio/realtime_impl.h>
#ifdef HAVE_SCHED_H
@@ -109,8 +111,12 @@ rt_status_t enable_realtime_scheduling(rt_sched_param p)
if (result == EPERM) // N.B., return value, not errno
return RT_NO_PRIVS;
else {
- fprintf(stderr,
- "pthread_setschedparam: failed to set real time priority: %s\n",
+ gr::logger_ptr logger, debug_logger;
+ gr::configure_default_loggers(logger, debug_logger, "realtime_impl");
+ GR_LOG_ERROR(
+ logger,
+ boost::format(
+ "pthread_setschedparam: failed to set real time priority: %s") %
strerror(result));
return RT_OTHER_ERROR;
}
@@ -148,7 +154,11 @@ rt_status_t enable_realtime_scheduling(rt_sched_param p)
if (errno == EPERM)
return RT_NO_PRIVS;
else {
- perror("sched_setscheduler: failed to set real time priority");
+ gr::logger_ptr logger, debug_logger;
+ gr::configure_default_loggers(logger, debug_logger, "realtime_impl");
+ GR_LOG_ERROR(
+ logger,
+ boost::format("sched_setscheduler: failed to set real time priority."));
return RT_OTHER_ERROR;
}
}