1 | /* |
2 | Copyright (c) 2008 Volker Krause <vkrause@kde.org> |
3 | |
4 | This library is free software; you can redistribute it and/or modify it |
5 | under the terms of the GNU Library General Public License as published by |
6 | the Free Software Foundation; either version 2 of the License, or (at your |
7 | option) any later version. |
8 | |
9 | This library is distributed in the hope that it will be useful, but WITHOUT |
10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
11 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public |
12 | License for more details. |
13 | |
14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to the |
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
17 | 02110-1301, USA. |
18 | */ |
19 | |
20 | #ifndef AKDEBUG_H |
21 | #define AKDEBUG_H |
22 | |
23 | #include <QDebug> |
24 | |
25 | /** |
26 | * Writes an error message to stdout/err and to the server error log and |
27 | * aborts the program immediately. |
28 | */ |
29 | QDebug akFatal(); |
30 | |
31 | /** |
32 | * Writes an error messasge to stdout/err and to the server error log. |
33 | */ |
34 | QDebug akError(); |
35 | |
36 | /** |
37 | * Writes a debug message to stdout/err. |
38 | */ |
39 | #ifndef QT_NO_DEBUG_OUTPUT |
40 | QDebug akDebug(); |
41 | #else |
42 | inline QNoDebug akDebug() { |
43 | return QNoDebug(); |
44 | } |
45 | #endif |
46 | |
47 | /** |
48 | * Init and rotate error logs. |
49 | */ |
50 | void akInit(const QString &appName); |
51 | |
52 | /** |
53 | * Returns the contents of @p name environment variable if it is defined, |
54 | * or @p defaultValue otherwise. |
55 | */ |
56 | QString getEnv(const char *name, const QString &defaultValue = QString()); |
57 | |
58 | #endif |
59 | |