diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2020-04-11 00:46:24 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2020-04-13 15:55:41 +0200 |
commit | 337b99e78fddb4589ebbc793d7f4784daa4314d8 (patch) | |
tree | 1f0003755f7a13056ce2600475298a4dbcaa6ef0 /gr-audio/lib/osx/osx_impl.cc | |
parent | 0f88db1ef0569bf6fcd5e9c843da38d487a6f54b (diff) |
audio: replace stderr logging by calls to GR's logging facilties
This is a bit special, in that audio systems tend to have their own ways
of going wrong, and there's platform-specific development debugging
infrastructure in there, which I intentionally did not touch.
I did touch a few commented lines of code in the intention of, if you
enable that line of logging, it should be consistent with the rest.
There's copious amounts of untouched stderr-logging in `#if 0`-disabled
code in OSX's infrastructure.
Diffstat (limited to 'gr-audio/lib/osx/osx_impl.cc')
-rw-r--r-- | gr-audio/lib/osx/osx_impl.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gr-audio/lib/osx/osx_impl.cc b/gr-audio/lib/osx/osx_impl.cc index 2b1df1ee8f..15329f012f 100644 --- a/gr-audio/lib/osx/osx_impl.cc +++ b/gr-audio/lib/osx/osx_impl.cc @@ -15,6 +15,7 @@ #include "../audio_registry.h" #include <gnuradio/audio/osx_impl.h> +#include <gnuradio/logger.h> #include <algorithm> #include <iostream> @@ -151,8 +152,12 @@ void find_audio_devices(const std::string& device_name, if ((err = AudioObjectGetPropertyDataSize( kAudioObjectSystemObject, &ao_address, 0, NULL, &prop_size)) != noErr) { #if _OSX_AU_DEBUG_ - std::cerr << "audio_osx::find_audio_devices: " - << "Unable to retrieve number of audio objects: " << err << std::endl; + gr::logger_ptr logger, debug_logger; + gr::configure_default_loggers( + logger, debug_logger, "osx_impl::find_audio_devices"); + std::ostringstream msg; + msg << "Unable to retrieve number of audio objects: " << err; + GR_LOG_ERROR(logger, msg.str()); #endif return; } @@ -172,8 +177,9 @@ void find_audio_devices(const std::string& device_name, &prop_size, all_dev_ids.get())) != noErr) { #if _OSX_AU_DEBUG_ - std::cerr << "audio_osx::find_audio_devices: " - << "Unable to retrieve audio object ids: " << err << std::endl; + std::ostringstream msg; + msg << "Unable to retrieve audio object ids: " << err; + GR_LOG_ERROR(logger, msg.str()); #endif return; } @@ -227,9 +233,9 @@ void find_audio_devices(const std::string& device_name, if ((err = AudioObjectGetPropertyData( t_id, &ao_address, 0, NULL, &prop_size, (void*)c_name_buf)) != noErr) { #if _OSX_AU_DEBUG_ - std::cerr << "audio_osx::find_audio_devices: " - << "Unable to retrieve audio device name #" << (nn + 1) << ": " - << err << std::endl; + std::ostringstream msg; + msg << "Unable to retrieve audio device name #" << (nn + 1) << ": " << err; + GR_LOG_ERROR(logger, msg.str()); #endif continue; } |