From b5c4abf714651cafc0c95510bf60acbe3748fc65 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 21 Apr 2015 15:38:52 +0000 Subject: [PATCH] Adjust Hamlib trace verbosity levels Release builds were incrorrectly selecting a high level of Hamlib trace verbosity. Added a new CMake option to turn on maximum Hamlib trace verbosity when required (WSJT_HAMLIB_VERBOSE_TRACE default=OFF). The current WSJT_HAMLIB_TRACE (default=OFF) now only turns on tracing at warning level and above, this option must be set ON before the WSJT_HAMLIB_VERBOSE_TRACE option becomes available. Release configuration builds use a Hamlib trace level of error or above by default. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5261 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- CMakeLists.txt | 5 +++-- HamlibTransceiver.cpp | 20 ++++++++++++++------ wsjtx_config.h.in | 1 + 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 715d1a6ab..7500a9e23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,15 +109,16 @@ option (WSJT_SHARED_RUNTIME "Debugging option that allows running from a shared option (WSJT_QDEBUG_TO_FILE "Redirect Qt debuging messages to a trace file.") option (WSJT_TRACE_CAT "Debugging option that turns on CAT diagnostics.") option (WSJT_TRACE_CAT_POLLS "Debugging option that turns on CAT diagnostics during polling.") -option (WSJT_HAMLIB_TRACE "Debugging option that turns on full Hamlib internal diagnostics.") +option (WSJT_HAMLIB_TRACE "Debugging option that turns on minimal Hamlib internal diagnostics.") option (WSJT_SOFT_KEYING "Apply a ramp to CW keying envelope to reduce transients." ON) option (WSJT_SKIP_MANPAGES "Skip *nix manpage generation.") option (WSJT_EMBED_SAMPLES "Embed sample files into WSJT-X resources." ON) +CMAKE_DEPENDENT_OPTION (WSJT_HAMLIB_VERBOSE_TRACE "Debugging option that turns on full Hamlib internal diagnostics." OFF WSJT_HAMLIB_TRACE OFF) CMAKE_DEPENDENT_OPTION (WSJT_QDEBUG_IN_RELEASE "Leave Qt debugging statements in Release configuration." OFF "NOT is_debug_build" OFF) CMAKE_DEPENDENT_OPTION (WSJT_ENABLE_EXPERIMENTAL_FEATURES "Enable features not fully ready for public releases." ON - "is_debug_build" OFF) + is_debug_build OFF) CMAKE_DEPENDENT_OPTION (WSJT_CREATE_WINMAIN "The wsjtx target is normally built as GUI executable with a WinMain entry point on Windows, if you want a console application instead then set this option to OFF. diff --git a/HamlibTransceiver.cpp b/HamlibTransceiver.cpp index 3fbfa1737..bc957c45c 100644 --- a/HamlibTransceiver.cpp +++ b/HamlibTransceiver.cpp @@ -131,11 +131,15 @@ void HamlibTransceiver::register_transceivers (TransceiverFactory::Transceivers rig_set_debug_callback (debug_callback, nullptr); #if WSJT_HAMLIB_TRACE +#if WSJT_HAMLIB_VERBOSE_TRACE rig_set_debug (RIG_DEBUG_TRACE); +#else + rig_set_debug (RIG_DEBUG_VERBOSE); +#endif #elif defined (NDEBUG) rig_set_debug (RIG_DEBUG_ERR); #else - rig_set_debug (RIG_DEBUG_VERBOSE); + rig_set_debug (RIG_DEBUG_WARN); #endif rig_load_all_backends (); @@ -703,7 +707,7 @@ void HamlibTransceiver::poll () #if defined (NDEBUG) rig_set_debug (RIG_DEBUG_ERR); #else - rig_set_debug (RIG_DEBUG_VERBOSE); + rig_set_debug (RIG_DEBUG_WARN); #endif #endif @@ -832,11 +836,15 @@ void HamlibTransceiver::poll () #if !WSJT_TRACE_CAT_POLLS #if WSJT_HAMLIB_TRACE - rig_set_debug (RIG_DEBUG_TRACE); -#elif defined (NDEBUG) - rig_set_debug (RIG_DEBUG_ERR); +#if WSJT_HAMLIB_VERBOSE_TRACE + rig_set_debug (RIG_DEBUG_TRACE); #else - rig_set_debug (RIG_DEBUG_VERBOSE); + rig_set_debug (RIG_DEBUG_VERBOSE); +#endif +#elif defined (NDEBUG) + rig_set_debug (RIG_DEBUG_ERR); +#else + rig_set_debug (RIG_DEBUG_WARN); #endif #endif } diff --git a/wsjtx_config.h.in b/wsjtx_config.h.in index f8707dc82..4a564e2d6 100644 --- a/wsjtx_config.h.in +++ b/wsjtx_config.h.in @@ -22,6 +22,7 @@ #cmakedefine01 WSJT_TRACE_CAT #cmakedefine01 WSJT_TRACE_CAT_POLLS #cmakedefine01 WSJT_HAMLIB_TRACE +#cmakedefine01 WSJT_HAMLIB_VERBOSE_TRACE #cmakedefine01 WSJT_SOFT_KEYING #cmakedefine01 WSJT_ENABLE_EXPERIMENTAL_FEATURES #cmakedefine01 WSJT_INCLUDE_KVASD