diff options
m--------- | gnuradio | 0 | ||||
-rw-r--r-- | lib/CMakeLists.txt | 1 | ||||
-rw-r--r-- | lib/debug.cpp | 35 | ||||
-rw-r--r-- | lib/gras_impl/debug.hpp | 4 |
4 files changed, 38 insertions, 2 deletions
diff --git a/gnuradio b/gnuradio -Subproject 5b64019e6c1640edd13ae04fea251b144c0d2fb +Subproject 00eca71506a89b19fff2081d158a3da5a36a18e diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 414e13a..1cea8c8 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -22,6 +22,7 @@ endif() # Append gnuradio-core library sources ######################################################################## list(APPEND gnuradio_core_sources + ${CMAKE_CURRENT_SOURCE_DIR}/debug.cpp ${CMAKE_CURRENT_SOURCE_DIR}/element.cpp ${CMAKE_CURRENT_SOURCE_DIR}/sbuffer.cpp ${CMAKE_CURRENT_SOURCE_DIR}/block.cpp diff --git a/lib/debug.cpp b/lib/debug.cpp new file mode 100644 index 0000000..474e83d --- /dev/null +++ b/lib/debug.cpp @@ -0,0 +1,35 @@ +// +// Copyright 2012 Josh Blum +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with io_sig program. If not, see <http://www.gnu.org/licenses/>. + +#include <gras_impl/debug.hpp> + +#ifdef ASSERTING + +struct DebugAssertPrinter +{ + DebugAssertPrinter(void) + { + std::cerr + << "###################################################\n" + << "## ATTENTION!!! The debug asserts are enabled\n" + << "###################################################\n" + << std::flush; + } +}; + +static const DebugAssertPrinter dap; + +#endif diff --git a/lib/gras_impl/debug.hpp b/lib/gras_impl/debug.hpp index 69f7b4a..5aa8e8e 100644 --- a/lib/gras_impl/debug.hpp +++ b/lib/gras_impl/debug.hpp @@ -66,12 +66,12 @@ struct WorkDebugPrinter WorkDebugPrinter(const std::string &name): lock(work_debug_mutex), name(name) { - std::cout << "-----> begin work on " << name << std::endl; + std::cerr << "-----> begin work on " << name << std::endl; } ~WorkDebugPrinter(void) { - std::cout << "<----- end work on " << name << std::endl; + std::cerr << "<----- end work on " << name << std::endl; } boost::mutex::scoped_lock lock; |