diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2020-04-11 00:43:39 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2020-04-13 15:55:41 +0200 |
commit | 0f88db1ef0569bf6fcd5e9c843da38d487a6f54b (patch) | |
tree | 4c9827377c0e98fe223f39edb0c84c8a49c199e9 /gnuradio-runtime/lib/pagesize.cc | |
parent | ec8a92846a388cb0d2982822ea1961910cd552f8 (diff) |
runtime: replace stderr logging by calls to GR's logging facilties
Diffstat (limited to 'gnuradio-runtime/lib/pagesize.cc')
-rw-r--r-- | gnuradio-runtime/lib/pagesize.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gnuradio-runtime/lib/pagesize.cc b/gnuradio-runtime/lib/pagesize.cc index ef149de629..9568ae76da 100644 --- a/gnuradio-runtime/lib/pagesize.cc +++ b/gnuradio-runtime/lib/pagesize.cc @@ -12,6 +12,9 @@ #include "config.h" #endif +#include <gnuradio/logger.h> +#include <gnuradio/prefs.h> + #include "pagesize.h" #include <stdio.h> #include <unistd.h> @@ -25,6 +28,8 @@ extern "C" size_t getpagesize(void); int pagesize() { static int s_pagesize = -1; + gr::logger_ptr logger, debug_logger; + gr::configure_default_loggers(logger, debug_logger, "pagesize"); if (s_pagesize == -1) { #if defined(HAVE_GETPAGESIZE) @@ -32,11 +37,11 @@ int pagesize() #elif defined(HAVE_SYSCONF) s_pagesize = sysconf(_SC_PAGESIZE); if (s_pagesize == -1) { - perror("_SC_PAGESIZE"); + GR_LOG_ERROR(logger, boost::format("_SC_PAGESIZE: %s") strerror(errno)); s_pagesize = 4096; } #else - fprintf(stderr, "gr::pagesize: no info; setting pagesize = 4096\n"); + GR_LOG_ERROR(logger, "no info; setting pagesize = 4096"); s_pagesize = 4096; #endif } |