00001 // -*- mode: c++; indent-tabs-mode: nil; -*- 00002 // 00003 //The Biomolecule Toolkit (BTK) is a C++ library for use in the 00004 //modeling, analysis, and design of biological macromolecules. 00005 //Copyright (C) 2006, Tim Robertson <kid50@users.sourceforge.net> 00006 // 00007 //This program is free software; you can redistribute it and/or modify 00008 //it under the terms of the GNU Lesser General Public License as published 00009 //by the Free Software Foundation; either version 2.1 of the License, or (at 00010 //your option) any later version. 00011 // 00012 //This program is distributed in the hope that it will be useful, but 00013 //WITHOUT ANY WARRANTY; without even the implied warranty of 00014 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 //Lesser General Public License for more details. 00016 // 00017 //You should have received a copy of the GNU Lesser General Public License 00018 //along with this program; if not, write to the Free Software Foundation, 00019 //Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00020 00023 00024 #ifndef BTK_COMMON_DEBUGGING_HPP 00025 #define BTK_COMMON_DEBUGGING_HPP 00026 00027 #include <btk/core/config/btk_config.hpp> 00028 #include <btk/core/io/logger_stream.hpp> 00029 00030 // These using declarations are necessary for older versions 00031 // of g++, which have namespace scoping difficulties when using the 00032 // stream insertion operator. They should probably be selectively 00033 // enabled only for broken compilers, but for now, I'm lazy. 00034 using BTK::IO::LOGGING::DEBUG; 00035 using BTK::IO::LOGGING::TRACE; 00036 00037 #ifndef BTK_NDEBUG 00038 # define DBG_STREAM(L) BTK::IO::LOGGING::LoggerStream<char>((L)) 00039 # define DBG_OUT DBG_STREAM(DEBUG) 00040 #else 00041 # define DBG_STREAM(L) if (0) BTK::IO::LOGGING::LoggerStream<char>((L)) 00042 # define DBG_OUT DBG_STREAM(DEBUG) 00043 #endif 00044 00045 #ifdef BTK_TRACE 00046 # define TRACE_OUT BTK::IO::LOGGING::LoggerStream<char>(TRACE) << ' ' 00047 #else 00048 # define TRACE_OUT if (0) BTK::IO::LOGGING::LoggerStream<char>(TRACE) 00049 #endif 00050 00051 #endif // BTK_COMMON_DEBUGGING_HPP