libqutim  0.3.3.0
debug.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** qutIM - instant messenger
4 **
5 ** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
6 **
7 *****************************************************************************
8 **
9 ** $QUTIM_BEGIN_LICENSE$
10 ** This program is free software: you can redistribute it and/or modify
11 ** it under the terms of the GNU General Public License as published by
12 ** the Free Software Foundation, either version 3 of the License, or
13 ** (at your option) any later version.
14 **
15 ** This program is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 ** See the GNU General Public License for more details.
19 **
20 ** You should have received a copy of the GNU General Public License
21 ** along with this program. If not, see http://www.gnu.org/licenses/.
22 ** $QUTIM_END_LICENSE$
23 **
24 ****************************************************************************/
25 
26 #ifndef DEBUG_H
27 #define DEBUG_H
28 
29 // Include QDebug, because we want to redefine some symbols
30 #include <QDebug>
31 #include "libqutim_global.h"
32 
33 namespace qutim_sdk_0_3
34 {
35  enum DebugLevel
36  {
37  DebugInfo = 0,
40  };
41 
42  LIBQUTIM_EXPORT QDebug debug_helper(quint64, DebugLevel, QtMsgType);
43  LIBQUTIM_EXPORT void debugAddPluginId(quint64, const QMetaObject *meta);
45 
46 #ifndef QUTIM_PLUGIN_ID
47  LIBQUTIM_NO_EXPORT inline QDebug debug(DebugLevel level = DebugInfo)
48  { return debug_helper(0, level, QtDebugMsg); }
49  LIBQUTIM_NO_EXPORT inline QDebug warning(DebugLevel level = DebugInfo)
50  { return debug_helper(0, level, QtWarningMsg); }
51  LIBQUTIM_NO_EXPORT inline QDebug critical(DebugLevel level = DebugInfo)
52  { return debug_helper(0, level, QtCriticalMsg); }
53  LIBQUTIM_NO_EXPORT inline QDebug fatal(DebugLevel level = DebugInfo)
54  { return debug_helper(0, level, QtFatalMsg); }
55 #else
56 # define QUTIM_DEBUG_ID_CONVERT_HELPER(A) 0x ## A ## ULL
57 # define QUTIM_DEBUG_ID_CONVERT(A) QUTIM_DEBUG_ID_CONVERT_HELPER(A)
58  LIBQUTIM_NO_EXPORT inline quint64 qutim_plugin_id()
59  { return QUTIM_DEBUG_ID_CONVERT(QUTIM_PLUGIN_ID); }
60  LIBQUTIM_NO_EXPORT inline QDebug debug(DebugLevel level = DebugInfo)
61  { return debug_helper(qutim_plugin_id(), level, QtDebugMsg); }
62  LIBQUTIM_NO_EXPORT inline QDebug warning(DebugLevel level = DebugInfo)
63  { return debug_helper(qutim_plugin_id(), level, QtWarningMsg); }
64  LIBQUTIM_NO_EXPORT inline QDebug critical(DebugLevel level = DebugInfo)
65  { return debug_helper(qutim_plugin_id(), level, QtCriticalMsg); }
66  LIBQUTIM_NO_EXPORT inline QDebug fatal(DebugLevel level = DebugInfo)
67  { return debug_helper(qutim_plugin_id(), level, QtFatalMsg); }
68 # undef QUTIM_DEBUG_ID_CONVERT_HELPER
69 # undef QUTIM_DEBUG_ID_CONVERT
70 #endif
71 }
72 #endif // DEBUG_H
73 
qutim_sdk_0_3::debugClearConfig
Q_DECL_IMPORT void debugClearConfig()
LIBQUTIM_NO_EXPORT
#define LIBQUTIM_NO_EXPORT
Definition: libqutim_global.h:39
qutim_sdk_0_3::debugAddPluginId
Q_DECL_IMPORT void debugAddPluginId(quint64, const QMetaObject *meta)
qutim_sdk_0_3::critical
QDebug critical(DebugLevel level=DebugInfo)
Definition: debug.h:74
qutim_sdk_0_3::DebugInfo
@ DebugInfo
Definition: debug.h:83
qutim_sdk_0_3::debug_helper
Q_DECL_IMPORT QDebug debug_helper(quint64, DebugLevel, QtMsgType)
LIBQUTIM_EXPORT
#define LIBQUTIM_EXPORT
Definition: libqutim_global.h:45
qutim_sdk_0_3::DebugVeryVerbose
@ DebugVeryVerbose
Definition: debug.h:85
qutim_sdk_0_3
Definition: abstractsearchrequest.h:33
qutim_sdk_0_3::DebugVerbose
@ DebugVerbose
Definition: debug.h:84
libqutim_global.h
qutim_sdk_0_3::warning
QDebug warning(DebugLevel level=DebugInfo)
Definition: debug.h:72
qutim_sdk_0_3::debug
QDebug debug(DebugLevel level=DebugInfo)
Definition: debug.h:70
qutim_sdk_0_3::fatal
QDebug fatal(DebugLevel level=DebugInfo)
Definition: debug.h:76
qutim_sdk_0_3::DebugLevel
DebugLevel
Definition: debug.h:58

Generated by Doxygen