File indexing completed on 2024-12-01 07:24:51

0001 /* This file is part of the KDE project
0002    Copyright (C) 2015 Laurent Montel <montel@kde.org>
0003 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2 of the License, or (at your option) any later version.
0008 
0009    This library is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this library; see the file COPYING.LIB.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef KDB_DEBUG_H
0021 #define KDB_DEBUG_H
0022 
0023 #include "config-kdb.h"
0024 #include "config-kdb-private.h"
0025 
0026 #include <QLoggingCategory>
0027 Q_DECLARE_LOGGING_CATEGORY(KDB_LOG)
0028 
0029 //! Debug command for the core KDb code
0030 #define kdbDebug(...) qCDebug(KDB_LOG, __VA_ARGS__)
0031 
0032 //! Warning command for the core KDb code
0033 #define kdbWarning(...) qCWarning(KDB_LOG, __VA_ARGS__)
0034 
0035 //! Critical command for the core KDb code
0036 #define kdbCritical(...) qCCritical(KDB_LOG, __VA_ARGS__)
0037 
0038 #ifdef KDB_EXPRESSION_DEBUG
0039 # define ExpressionDebug kdbDebug()
0040 #else
0041 # define ExpressionDebug if (1) {} else kdbDebug()
0042 #endif
0043 
0044 #ifdef KDB_DRIVERMANAGER_DEBUG
0045 # define drivermanagerDebug(...) kdbDebug(__VA_ARGS__)
0046 #else
0047 # define drivermanagerDebug(...) if (1) {} else kdbDebug(__VA_ARGS__)
0048 #endif
0049 
0050 #ifdef KDB_TRANSACTIONS_DEBUG
0051 # define transactionsDebug(...) kdbDebug(__VA_ARGS__)
0052 #else
0053 # define transactionsDebug(...) if (1) {} else kdbDebug(__VA_ARGS__)
0054 #endif
0055 
0056 #ifdef KDB_QUERYSCHEMA_DEBUG
0057 # define querySchemaDebug(...) kdbDebug(__VA_ARGS__)
0058 #else
0059 # define querySchemaDebug(...) if (1) {} else kdbDebug(__VA_ARGS__)
0060 #endif
0061 
0062 #ifdef KDB_SQLPARSER_DEBUG
0063 # define sqlParserDebug(...) kdbDebug(__VA_ARGS__)
0064 #else
0065 # define sqlParserDebug(...) if (1) {} else kdbDebug(__VA_ARGS__)
0066 #endif
0067 
0068 #endif