diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 22:38:03 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 22:38:03 +0000 |
commit | dadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (patch) | |
tree | 99e72842fe687baea16376a147619b6048d7e441 /kmymoney2/reports/reportdebug.h | |
download | kmymoney-dadc34655c3ab961b0b0b94a10eaaba710f0b5e8.tar.gz kmymoney-dadc34655c3ab961b0b0b94a10eaaba710f0b5e8.zip |
Added kmymoney
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239792 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/reports/reportdebug.h')
-rw-r--r-- | kmymoney2/reports/reportdebug.h | 83 |
1 files changed, 83 insertions, 0 deletions
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 : <ace.j@hotpop.com> + Thomas Baumgart <ipwizard@users.sourceforge.net> + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 |