summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/realtime_impl.cc
diff options
context:
space:
mode:
authorMarcus Müller <mmueller@gnuradio.org>2020-04-11 00:43:39 +0200
committerMarcus Müller <marcus@hostalia.de>2020-04-13 15:55:41 +0200
commit0f88db1ef0569bf6fcd5e9c843da38d487a6f54b (patch)
tree4c9827377c0e98fe223f39edb0c84c8a49c199e9 /gnuradio-runtime/lib/realtime_impl.cc
parentec8a92846a388cb0d2982822ea1961910cd552f8 (diff)
runtime: replace stderr logging by calls to GR's logging facilties
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;
}
}