/**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** ** This file is part of the QtLogger module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QLOGGING_P_H #define QLOGGING_P_H #include #include #include #include #include #include "qlogger.h" QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QFileSystemWatcher; QT_END_NAMESPACE QT_LOGGER_BEGIN_NAMESPACE class QLogConfigFilterItem { public: QLogConfigFilterItem(const QString &category, bool active); int pass(QLoggingCategory *log, const QtMsgType &type); void parse(); int _type; QString _category; bool _active; }; class QLoggingPrivate : public QObject { Q_OBJECT public: QLoggingPrivate(); virtual ~QLoggingPrivate(); static QString resolveConfigFile(const QString &path); void setLoggingRulesFile(const QString &path); void setLoggingRules(const QByteArray &configcontent); bool isEnabled(QLoggingCategory &category, QtMsgType type); void unregisterCategory(QLoggingCategory &category); Q_INVOKABLE void createFileWatcher(); void readSettings(QIODevice &device); void updateCategory(QLoggingCategory *log); #ifdef QT_BUILD_INTERNAL Q_SIGNALS: void configurationChanged(); #endif public slots: void fileChanged(const QString &path); public: QFileSystemWatcher *_configFileWatcher; QList _registeredCategories; QString _configFile; QMutex _mutexRegisteredCategory; QList _logConfigItemList; }; class QLoggingCategoryPrivate { public: QLoggingCategoryPrivate(const char *category); virtual ~QLoggingCategoryPrivate(); bool statusMessageType(const QtMsgType &type); bool _enabledDebug; bool _enabledWarning; bool _enabledCritical; bool _registered; const char *_categoryName; int _references; }; class QLoggingCategoryDefault : public QLoggingCategory { public: QLoggingCategoryDefault(); }; Q_AUTOTEST_EXPORT QLoggingPrivate *qtLoggerInstance(); QT_END_HEADER QT_LOGGER_END_NAMESPACE #endif //QLOGGING_P_H