From a59c217205fb85a1a37c74c01d39a31b843a5e11 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 6 Jul 2023 16:13:24 -0600 Subject: [PATCH] extend PBD::Debug API to provide a method that doesn't send to debug Transmitter --- libs/pbd/debug.cc | 9 ++++++++- libs/pbd/pbd/debug.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/pbd/debug.cc b/libs/pbd/debug.cc index e9aa1e5d26..c145a9c9e3 100644 --- a/libs/pbd/debug.cc +++ b/libs/pbd/debug.cc @@ -100,13 +100,20 @@ PBD::new_debug_bit (const char* name) } void -PBD::debug_print (const char* prefix, string str) +PBD::debug_only_print (const char* prefix, string str) { if ((PBD::debug_bits & DEBUG::DebugTimestamps).any()) { printf ("%ld %s: %s", g_get_monotonic_time(), prefix, str.c_str()); } else { printf ("%s: %s", prefix, str.c_str()); } +} + +void +PBD::debug_print (const char* prefix, string str) +{ + debug_only_print (prefix, str); + if ((PBD::debug_bits & DEBUG::DebugLogToGUI).any()) { std::replace (str.begin (), str.end (), '\n', ' '); debug << prefix << ": " << str << endmsg; diff --git a/libs/pbd/pbd/debug.h b/libs/pbd/pbd/debug.h index bda8bd7c7e..fdd7f6d503 100644 --- a/libs/pbd/pbd/debug.h +++ b/libs/pbd/pbd/debug.h @@ -44,6 +44,7 @@ namespace PBD { LIBPBD_API extern DebugBits debug_bits; LIBPBD_API DebugBits new_debug_bit (const char* name); LIBPBD_API void debug_print (const char* prefix, std::string str); + LIBPBD_API void debug_only_print (const char* prefix, std::string str); LIBPBD_API void set_debug_bits (DebugBits bits); LIBPBD_API int parse_debug_options (const char* str); LIBPBD_API void list_debug_options ();