diff --git a/libs/pbd/debug.cc b/libs/pbd/debug.cc index 39fa600899..c0c6ab65db 100644 --- a/libs/pbd/debug.cc +++ b/libs/pbd/debug.cc @@ -60,6 +60,7 @@ DebugBits PBD::DEBUG::Timing = PBD::new_debug_bit ("timing"); DebugBits PBD::DEBUG::Threads = PBD::new_debug_bit ("threads"); DebugBits PBD::DEBUG::Locale = PBD::new_debug_bit ("locale"); DebugBits PBD::DEBUG::StringConvert = PBD::new_debug_bit ("stringconvert"); +DebugBits PBD::DEBUG::DebugTimestamps = PBD::new_debug_bit ("debugtimestamps"); /* These are debug bits that are used by backends. Since these are loaded dynamically, after command-line parsing, defining them in code that is part of the backend @@ -98,6 +99,9 @@ PBD::new_debug_bit (const char* name) void PBD::debug_print (const char* prefix, string str) { + if ((PBD::debug_bits & DEBUG::DebugTimestamps).any()) { + cout << g_get_monotonic_time() << ' '; + } cout << prefix << ": " << str; } diff --git a/libs/pbd/pbd/debug.h b/libs/pbd/pbd/debug.h index c4d1b0ede8..7d3a901a11 100644 --- a/libs/pbd/pbd/debug.h +++ b/libs/pbd/pbd/debug.h @@ -62,6 +62,7 @@ namespace PBD { LIBPBD_API extern DebugBits Threads; LIBPBD_API extern DebugBits Locale; LIBPBD_API extern DebugBits StringConvert; + LIBPBD_API extern DebugBits DebugTimestamps; /* See notes in ../debug.cc on why these are defined here */