--- a/rsp2_impl.cc 2022-03-23 10:04:01 +++ b/rsp2_impl.cc 2022-03-23 13:32:42 @@ -47,7 +47,7 @@ const std::string rsp2_impl::set_antenna(const std::string& antenna) { if (antennas.count(antenna) == 0) { - GR_LOG_WARN(d_logger, boost::format("invalid antenna: %s") % antenna); + d_logger->warn("invalid antenna: {0}", antenna); return get_antenna(); } @@ -152,7 +152,7 @@ sdrplay_api_DeviceParamsT *params; sdrplay_api_ErrT err = sdrplay_api_GetDeviceParams(device.dev, ¶ms); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_GetDeviceParams() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_GetDeviceParams() Error: {0}", sdrplay_api_GetErrorString(err)); return; } std::cerr << "# RSP2 specific config:" << std::endl; --- a/rsp_impl.cc 2022-03-23 10:04:01 +++ b/rsp_impl.cc 2022-03-23 13:37:56 @@ -44,7 +44,7 @@ sdrplay_api_ErrT err; err = sdrplay_api_LockDeviceApi(); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_LockDeviceApi() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_LockDeviceApi() Error: {0}", sdrplay_api_GetErrorString(err)); } bool device_valid = rsp_select(hwVer, selector); @@ -54,13 +54,13 @@ if (device_valid) { err = sdrplay_api_SelectDevice(&device); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_SelectDevice() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_SelectDevice() Error: {0}", sdrplay_api_GetErrorString(err)); } } err = sdrplay_api_UnlockDeviceApi(); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_UnlockDeviceApi() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_UnlockDeviceApi() Error: {0}", sdrplay_api_GetErrorString(err)); } if (!device_valid) { @@ -69,7 +69,7 @@ err = sdrplay_api_GetDeviceParams(device.dev, &device_params); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_GetDeviceParams() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_GetDeviceParams() Error: {0}", sdrplay_api_GetErrorString(err)); } if (device_params) { rx_channel_params = device.tuner != sdrplay_api_Tuner_B ? @@ -102,7 +102,7 @@ sdrplay_api_ErrT err; err = sdrplay_api_LockDeviceApi(); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_LockDeviceApi() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_LockDeviceApi() Error: {0}", sdrplay_api_GetErrorString(err)); } // unset the ring buffers @@ -111,16 +111,16 @@ ring_buffers[1].xi = nullptr; ring_buffers[1].xq = nullptr; - GR_LOG_INFO(d_logger, boost::format("total samples: [%lu,%lu]") % ring_buffers[0].head % ring_buffers[1].head); + d_logger->info("total samples: [{0},{1}]", ring_buffers[0].head, ring_buffers[1].head); err = sdrplay_api_ReleaseDevice(&device); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_ReleaseDevice() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_ReleaseDevice() Error: {0}", sdrplay_api_GetErrorString(err)); } err = sdrplay_api_UnlockDeviceApi(); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_UnlockDeviceApi() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_UnlockDeviceApi() Error: {0}", sdrplay_api_GetErrorString(err)); } } @@ -137,14 +137,14 @@ { std::vector valid_rates = get_sample_rates(); if (!std::binary_search(valid_rates.begin(), valid_rates.end(), rate)) { - GR_LOG_WARN(d_logger, boost::format("invalid sample rate: %lgHz") % rate); + d_logger->warn("invalid sample rate: {0} Hz", rate); return get_sample_rate(); } if (rate == sample_rate) return get_sample_rate(); int decimation; - double fsHz; + double fsHz = 0.0f; sdrplay_api_If_kHzT if_type; if (rate == 62.5e3 || rate == 125e3 || rate == 250e3 || rate == 500e3 || rate == 1000e3 || rate == 2000e3) { @@ -153,7 +153,7 @@ sample_rate = 2000e3 / decimation; if_type = sdrplay_api_IF_1_620; } else { - int new_decimation; + int new_decimation = 1; double new_fsHz; for (new_decimation = 1; new_decimation <= 32; new_decimation *= 2) { new_fsHz = rate * new_decimation; @@ -243,7 +243,7 @@ double rsp_impl::set_bandwidth(const double bandwidth) { if (bandwidth > sample_rate) { - GR_LOG_WARN(d_logger, boost::format("invalid bandwidth: %lf - cannot be greater than sample rate: %lf") % bandwidth % sample_rate); + d_logger->warn("invalid bandwidth: {0} - cannot be greater than sample rate: {1}", bandwidth, sample_rate); return get_bandwidth(); } @@ -259,6 +259,8 @@ else if (bandwidth < 8000e3) { bw_type = sdrplay_api_BW_7_000; } else { bw_type = sdrplay_api_BW_8_000; } + d_logger->info("setting bandwidth: {0}", bandwidth); + if (bw_type == rx_channel_params->tunerParams.bwType) return get_bandwidth(); rx_channel_params->tunerParams.bwType = bw_type; @@ -325,7 +327,7 @@ } else if (name == "LNAstate") { return set_lna_state(gain, rf_gr_values()); } - GR_LOG_ERROR(d_logger, boost::format("invalid gain name: %s") % name); + d_logger->error("invalid gain name: {0}", name); return 0; } @@ -338,7 +340,7 @@ } else if (name == "LNAstate") { return get_lna_state(); } - GR_LOG_ERROR(d_logger, boost::format("invalid gain name: %s") % name); + d_logger->error("invalid gain name: {0}", name); return 0; } @@ -356,7 +358,7 @@ }; return LNAstate_range_double; } - GR_LOG_ERROR(d_logger, boost::format("invalid gain name: %s") % name); + d_logger->error("invalid gain name: {0}", name); static const double null_gain_range[] = { 0, 0 }; return null_gain_range; } @@ -402,7 +404,7 @@ int rsp_impl::set_lna_state(const int LNAstate, const std::vector rf_gRs) { if (LNAstate < 0 || LNAstate >= rf_gRs.size()) { - GR_LOG_ERROR(d_logger, boost::format("invalid LNA state: %d") % LNAstate); + d_logger->error("invalid LNA state: {0}", LNAstate); } else { rx_channel_params->tunerParams.gain.LNAstate = LNAstate; update_if_streaming(sdrplay_api_Update_Tuner_Gr); @@ -557,7 +559,7 @@ sdrplay_api_ErrT err; err = sdrplay_api_Init(device.dev, &callbackFns, this); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_Init() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_Init() Error: {0}", sdrplay_api_GetErrorString(err)); return false; } run_status = RunStatus::init; @@ -570,7 +572,7 @@ if (run_status >= RunStatus::init) { err = sdrplay_api_Uninit(device.dev); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_Uninit() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_Uninit() Error: {0}", sdrplay_api_GetErrorString(err)); return false; } } @@ -793,7 +795,7 @@ case sdrplay_api_GainChange: if (show_gain_changes) { sdrplay_api_GainCbParamT *gainParams = ¶ms->gainParams; - GR_LOG_INFO(d_logger, boost::format("gain change - gRdB=%u lnaGRdB=%u currGain=%lg") % gainParams->gRdB % gainParams->lnaGRdB % gainParams->currGain); + d_logger->info("gain change - gRdB={0} lnaGRdB={1} currGain={2:.2f}", gainParams->gRdB, gainParams->lnaGRdB, gainParams->currGain); } break; case sdrplay_api_PowerOverloadChange: @@ -801,10 +803,10 @@ if (run_status == RunStatus::streaming) { switch (params->powerOverloadParams.powerOverloadChangeType) { case sdrplay_api_Overload_Detected: - GR_LOG_WARN(d_logger, "overload detected - please reduce gain"); + d_logger->warn("overload detected - please reduce gain"); break; case sdrplay_api_Overload_Corrected: - GR_LOG_WARN(d_logger, "overload corrected"); + d_logger->warn("overload corrected"); break; } sdrplay_api_Update(device.dev, device.tuner, @@ -813,7 +815,7 @@ } break; case sdrplay_api_DeviceRemoved: - GR_LOG_ERROR(d_logger, "device removed"); + d_logger->error("device removed"); break; case sdrplay_api_RspDuoModeChange: break; @@ -827,7 +829,7 @@ sdrplay_api_ErrT err; err = sdrplay_api_DebugEnable(device.dev, enable ? sdrplay_api_DbgLvl_Verbose : sdrplay_api_DbgLvl_Disable); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_DebugEnable() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_DebugEnable() Error: {0}", sdrplay_api_GetErrorString(err)); } } @@ -850,7 +852,7 @@ sdrplay_api_ErrT err; err = sdrplay_api_GetDevices(devices, &ndevices, ndevices); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_GetDevices() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_GetDevices() Error: {0}", sdrplay_api_GetErrorString(err)); } // device index or serial number? bool device_found = false; @@ -880,7 +882,7 @@ } } if (!device_found) { - GR_LOG_ERROR(d_logger, boost::format("SDRplay device not found: %s") % selector); + d_logger->error("SDRplay device not found: {0}", selector); } return device_found; @@ -901,7 +903,7 @@ err = sdrplay_api_Update(device.dev, tuner, reason_for_update, sdrplay_api_Update_Ext1_None); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_Update(%s) Error: %s") % reason_as_text(reason_for_update) % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_Update({0}) Error: {1}", reason_as_text(reason_for_update), sdrplay_api_GetErrorString(err)); } } @@ -961,7 +963,7 @@ sdrplay_api_DeviceParamsT *params; sdrplay_api_ErrT err = sdrplay_api_GetDeviceParams(device.dev, ¶ms); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_GetDeviceParams() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_GetDeviceParams() Error: {0}", sdrplay_api_GetErrorString(err)); return; } std::cerr << std::endl; @@ -1013,10 +1015,9 @@ } else { sample_num_gap = UINT_MAX - (first_sample_num - next_sample_num) + 1; } - GR_LOG_WARN(logger, boost::format( - "sample num gap in stream %d: %u [%u:%u] -> %u+%u") % - stream_index % sample_num_gap % next_sample_num % - first_sample_num % (sample_num_gap / num_samples) % + logger->warn("sample num gap in stream {0}: {1} [{2}:{3}] -> {4}+{5}", + stream_index, sample_num_gap, next_sample_num, + first_sample_num, (sample_num_gap / num_samples), (sample_num_gap % num_samples)); } next_sample_num = first_sample_num + num_samples; --- a/rspduo_impl.cc 2022-03-23 10:04:01 +++ b/rspduo_impl.cc 2022-03-23 13:33:21 @@ -66,7 +66,7 @@ } std::vector valid_rates = get_sample_rates(); if (!std::binary_search(valid_rates.begin(), valid_rates.end(), rate)) { - GR_LOG_WARN(d_logger, boost::format("invalid sample rate: %lgHz") % rate); + d_logger->warn("invalid sample rate: {0} Hz", rate); return get_sample_rate(); } if (rate == sample_rate) @@ -103,7 +103,7 @@ void rspduo_impl::set_center_freq(const double freq_A, const double freq_B) { if (!device.rspDuoMode == sdrplay_api_RspDuoMode_Dual_Tuner) { - GR_LOG_WARN(d_logger, "invalid call to set_center_freq(freq_A, freq_B) - device is not in dual tuner mode"); + d_logger->warn("invalid call to set_center_freq(freq_A, freq_B) - device is not in dual tuner mode"); return; } sdrplay_api_TunerSelectT tuner = sdrplay_api_Tuner_Neither; @@ -148,13 +148,13 @@ device.rspDuoMode == sdrplay_api_RspDuoMode_Master) { if (!(antennas.at(antenna).tuner == sdrplay_api_Tuner_A || antennas.at(antenna).tuner == sdrplay_api_Tuner_B)) { - GR_LOG_WARN(d_logger, boost::format("invalid antenna: %s") % antenna); + d_logger->warn("invalid antenna: {0}", antenna); return get_antenna(); } } else if (device.rspDuoMode == sdrplay_api_RspDuoMode_Dual_Tuner || device.rspDuoMode == sdrplay_api_RspDuoMode_Slave) { if (!(antennas.at(antenna).tuner == device.tuner)) { - GR_LOG_WARN(d_logger, boost::format("invalid antenna: %s") % antenna); + d_logger->warn("invalid antenna: {0}", antenna); return get_antenna(); } } @@ -184,7 +184,7 @@ &device.tuner, tuner1AmPortSel); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_SwapRspDuoActiveTuner() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_SwapRspDuoActiveTuner() Error: {0}", sdrplay_api_GetErrorString(err)); } rx_channel_params = device.tuner != sdrplay_api_Tuner_B ? device_params->rxChannelA : @@ -193,7 +193,7 @@ } else if (device.rspDuoMode == sdrplay_api_RspDuoMode_Master) { // can't change tuner if a slave is attached if (rspduo_mode_change_type != sdrplay_api_SlaveDllDisappeared) { - GR_LOG_WARN(d_logger, "cannot change tuner in master mode while a slave is attached"); + d_logger->warn("cannot change tuner in master mode while a slave is attached"); tuner1AmPortSel = rx_channel_params->rspDuoTunerParams.tuner1AmPortSel; } else { // stop, change tuner, and restart @@ -260,14 +260,14 @@ } else if (name == "LNAstate") { return set_lna_state(gain, rf_gr_values(), tuner); } - GR_LOG_ERROR(d_logger, boost::format("invalid gain name: %s") % name); + d_logger->error("invalid gain name: {0}", name); return 0; } void rspduo_impl::set_gain(const double gain_A, const double gain_B, const std::string& name) { if (!device.rspDuoMode == sdrplay_api_RspDuoMode_Dual_Tuner) { - GR_LOG_WARN(d_logger, "invalid call to set_gain(gain_A, gain_B) - device is not in dual tuner mode"); + d_logger->warn("invalid call to set_gain(gain_A, gain_B) - device is not in dual tuner mode"); return; } if (name == "IF") { @@ -280,7 +280,7 @@ set_lna_state(gain_A, gain_B, rf_gr_values()); return; } - GR_LOG_ERROR(d_logger, boost::format("invalid gain name: %s") % name); + d_logger->error("invalid gain name: {0}", name); return; } @@ -293,7 +293,7 @@ } else if (name == "LNAstate") { return get_lna_state(tuner); } - GR_LOG_ERROR(d_logger, boost::format("invalid gain name: %s") % name); + d_logger->error("invalid gain name: {0}", name); return 0; } @@ -311,7 +311,7 @@ }; return LNAstate_range_double; } - GR_LOG_ERROR(d_logger, boost::format("invalid gain name: %s") % name); + d_logger->error("invalid gain name: {0}", name); static const double null_gain_range[] = { 0, 0 }; return null_gain_range; } @@ -430,7 +430,7 @@ sdrplay_api_RxChannelParamsT *indrx_chparams = get_independent_rx_channel_params(tuner); if (LNAstate < 0 || LNAstate >= rf_gRs.size()) { - GR_LOG_ERROR(d_logger, boost::format("invalid LNA state: %d") % LNAstate); + d_logger->error("invalid LNA state: {0}", LNAstate); } else { if (LNAstate == indrx_chparams->tunerParams.gain.LNAstate) return indrx_chparams->tunerParams.gain.LNAstate; @@ -445,11 +445,11 @@ const std::vector rf_gRs) { if (LNAstate_A < 0 || LNAstate_A >= rf_gRs.size()) { - GR_LOG_ERROR(d_logger, boost::format("invalid LNA state: %d") % LNAstate_A); + d_logger->error("invalid LNA state: {0}", LNAstate_A); return; } if (LNAstate_B < 0 || LNAstate_B >= rf_gRs.size()) { - GR_LOG_ERROR(d_logger, boost::format("invalid LNA state: %d") % LNAstate_B); + d_logger->error("invalid LNA state: {0}", LNAstate_B); return; } sdrplay_api_TunerSelectT tuner = sdrplay_api_Tuner_Neither; @@ -522,7 +522,7 @@ void rspduo_impl::set_gain_mode(bool automatic_A, bool automatic_B) { if (!device.rspDuoMode == sdrplay_api_RspDuoMode_Dual_Tuner) { - GR_LOG_WARN(d_logger, "invalid call to set_gain_mode(automatic_A, automatic_B) - device is not in dual tuner mode"); + d_logger->warn("invalid call to set_gain_mode(automatic_A, automatic_B) - device is not in dual tuner mode"); return; } sdrplay_api_AgcControlT enable_A = automatic_A ? sdrplay_api_AGC_CTRL_EN : sdrplay_api_AGC_DISABLE; @@ -603,7 +603,7 @@ if (eventId == sdrplay_api_RspDuoModeChange) { // save last RSPduo mode change rspduo_mode_change_type = params->rspDuoModeParams.modeChangeType; - GR_LOG_INFO(d_logger, boost::format("RSPduo mode change - modeChangeType=%u") % rspduo_mode_change_type); + d_logger->info("RSPduo mode change - modeChangeType={0}", rspduo_mode_change_type); } else { rsp_impl::event_callback(eventId, tuner, params); } @@ -619,7 +619,7 @@ if (valid_mode) { device.rspDuoMode = rspduo_modes.at(rspduo_mode).rspduo_mode; } else { - GR_LOG_ERROR(d_logger, boost::format("invalid RSPduo mode selection: %s") % rspduo_mode); + d_logger->error("invalid RSPduo mode selection: {0}", rspduo_mode); return valid_mode; } @@ -633,7 +633,7 @@ if (valid_tuner) { device.tuner = antennas.at(antenna).tuner; } else { - GR_LOG_ERROR(d_logger, boost::format("invalid RSPduo antenna selection: %s") % antenna); + d_logger->error("invalid RSPduo antenna selection: {0}", antenna); return valid_tuner; } @@ -644,7 +644,7 @@ { if (!(device.rspDuoMode == sdrplay_api_RspDuoMode_Dual_Tuner && dual_mode_independent_rx)) { - GR_LOG_WARN(d_logger, "invalid call to get_independent_rx_channel_params() - device is not in independent RX mode"); + d_logger->warn("invalid call to get_independent_rx_channel_params() - device is not in independent RX mode"); return nullptr; } return tuner != 1 ? device_params->rxChannelA : device_params->rxChannelB; @@ -654,7 +654,7 @@ { if (!(device.rspDuoMode == sdrplay_api_RspDuoMode_Dual_Tuner && dual_mode_independent_rx)) { - GR_LOG_WARN(d_logger, "invalid call to get_independent_rx_tuner() - device is not in independent RX mode"); + d_logger->warn("invalid call to get_independent_rx_tuner() - device is not in independent RX mode"); return sdrplay_api_Tuner_Neither; } return tuner != 1 ? sdrplay_api_Tuner_A : sdrplay_api_Tuner_B; @@ -667,7 +667,7 @@ sdrplay_api_DeviceParamsT *params; sdrplay_api_ErrT err = sdrplay_api_GetDeviceParams(device.dev, ¶ms); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_GetDeviceParams() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_GetDeviceParams() Error: {0}", sdrplay_api_GetErrorString(err)); return; } std::cerr << "# RSPduo specific config:" << std::endl; --- a/rspdx_impl.cc 2022-03-23 10:04:01 +++ b/rspdx_impl.cc 2022-03-23 13:33:38 @@ -42,7 +42,7 @@ const std::string rspdx_impl::set_antenna(const std::string& antenna) { if (antennas.count(antenna) == 0) { - GR_LOG_WARN(d_logger, boost::format("invalid antenna: %s") % antenna); + d_logger->warn("invalid antenna: {0}", antenna); return get_antenna(); } @@ -167,7 +167,7 @@ err = sdrplay_api_Update(device.dev, device.tuner, sdrplay_api_Update_None, reason_for_update); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_Update(%s) Error: %s") % reason_ext1_as_text(reason_for_update) % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_Update({0}) Error: {1}", reason_ext1_as_text(reason_for_update), sdrplay_api_GetErrorString(err)); } } @@ -203,7 +203,7 @@ sdrplay_api_DeviceParamsT *params; sdrplay_api_ErrT err = sdrplay_api_GetDeviceParams(device.dev, ¶ms); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_GetDeviceParams() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_GetDeviceParams() Error: {0}", sdrplay_api_GetErrorString(err)); return; } std::cerr << "# RSPdx specific config:" << std::endl; --- a/sdrplay_api.cc 2022-03-23 10:04:01 +++ b/sdrplay_api.cc 2022-03-23 13:34:07 @@ -31,8 +31,8 @@ // Open API err = sdrplay_api_Open(); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_Open() Error: %s") % sdrplay_api_GetErrorString(err)); - GR_LOG_ERROR(d_logger, "Please check the sdrplay_api service to make sure it is up. If it is up, please restart it."); + d_logger->error("sdrplay_api_Open() Error: {0}", sdrplay_api_GetErrorString(err)); + d_logger->error("Please check the sdrplay_api service to make sure it is up. If it is up, please restart it."); throw std::runtime_error("sdrplay_api_Open() failed"); } signal(SIGINT, signal_handler); @@ -43,13 +43,15 @@ // --TIMEOUT-- err = sdrplay_api_ApiVersion(&ver); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_ApiVersion() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_ApiVersion() Error: {0}", sdrplay_api_GetErrorString(err)); sdrplay_api_Close(); throw std::runtime_error("ApiVersion() failed"); } if (ver != SDRPLAY_API_VERSION) { - GR_LOG_WARN(d_logger, boost::format("sdrplay_api version: '%.3f' does not equal build version: '%.3f'") % ver % SDRPLAY_API_VERSION); + d_logger->warn("sdrplay_api version: '{0}' does not equal build version: '{1}'", ver, SDRPLAY_API_VERSION); } + else + d_logger->info("sdrplay_api version: '{0}' equals build version: '{1}'", ver, SDRPLAY_API_VERSION); } sdrplay_api::~sdrplay_api() @@ -58,7 +60,7 @@ // Close API err = sdrplay_api_Close(); if (err != sdrplay_api_Success) { - GR_LOG_ERROR(d_logger, boost::format("sdrplay_api_Close() Error: %s") % sdrplay_api_GetErrorString(err)); + d_logger->error("sdrplay_api_Close() Error: {0}", sdrplay_api_GetErrorString(err)); } }