2
* This file is part of system-settings
4
* Copyright (C) 2013 Canonical Ltd.
6
* Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
8
* This program is free software: you can redistribute it and/or modify it
9
* under the terms of the GNU General Public License version 3, as published
10
* by the Free Software Foundation.
12
* This program is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranties of
14
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15
* PURPOSE. See the GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License along
18
* with this program. If not, see <http://www.gnu.org/licenses/>.
20
#ifndef SYSTEM_SETTINGS_DEBUG_H
21
#define SYSTEM_SETTINGS_DEBUG_H
25
/* 0 - fatal, 1 - critical(default), 2 - info/debug */
26
extern int appLoggingLevel;
28
static inline bool debugEnabled()
30
return appLoggingLevel >= 2;
33
static inline int loggingLevel()
35
return appLoggingLevel;
38
void setLoggingLevel(int level);
42
if (debugEnabled()) qDebug() << __FILE__ << __LINE__ << __func__
44
#define DEBUG() while (0) qDebug()
47
#endif // SYSTEM_SETTINGS_DEBUG_H