From dadc34655c3ab961b0b0b94a10eaaba710f0b5e8 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 4 Jul 2011 22:38:03 +0000 Subject: Added kmymoney git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239792 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmymoney2/reports/reportdebug.h | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 kmymoney2/reports/reportdebug.h (limited to 'kmymoney2/reports/reportdebug.h') diff --git a/kmymoney2/reports/reportdebug.h b/kmymoney2/reports/reportdebug.h new file mode 100644 index 0000000..3a95465 --- /dev/null +++ b/kmymoney2/reports/reportdebug.h @@ -0,0 +1,83 @@ +/*************************************************************************** + reportdebug.h + ------------------- + begin : Sat May 22 2004 + copyright : (C) 2004-2005 by Ace Jones + email : + Thomas Baumgart + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef REPORTDEBUG_H +#define REPORTDEBUG_H + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +namespace reports { + +// define to enable massive debug logging to stderr +#undef DEBUG_REPORTS +// #define DEBUG_REPORTS + +#define DEBUG_ENABLED_BY_DEFAULT false + +#ifdef DEBUG_REPORTS + +// define to filter out account names & transaction amounts +// DO NOT check into CVS with this defined!! It breaks all +// unit tests. +#undef DEBUG_HIDE_SENSITIVE + +#define DEBUG_ENTER(x) Debug ___DEBUG(x) +#define DEBUG_OUTPUT(x) ___DEBUG.output(x) +#define DEBUG_OUTPUT_IF(x,y) { if (x) ___DEBUG.output(y); } +#define DEBUG_ENABLE(x) Debug::enable(x) +#define DEBUG_ENABLE_KEY(x) Debug::setEnableKey(x) +#ifdef DEBUG_HIDE_SENSITIVE +#define DEBUG_SENSITIVE(x) QString("hidden") +#else +#define DEBUG_SENSITIVE(x) (x) +#endif + +#else + +#define DEBUG_ENTER(x) +#define DEBUG_OUTPUT(x) +#define DEBUG_OUTPUT_IF(x,y) +#define DEBUG_ENABLE(x) +#define DEBUG_SENSITIVE(x) +#endif + +class Debug +{ + QString m_methodName; + static QString m_sTabs; + static bool m_sEnabled; + bool m_enabled; + static QString m_sEnableKey; +public: + Debug( const QString& _name ); + ~Debug(); + void output( const QString& _text ); + static void enable( bool _e ) { m_sEnabled = _e; } + static void setEnableKey( const QString& _s ) { m_sEnableKey = _s; } +}; + +} // end namespace reports + +#endif // REPORTDEBUG_H -- cgit v1.2.1