WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. Zuble QML Types   |  Zuble C++ Classes   |  Zuble Overview
Zuble  0.1
Zuble Framework C++/QML extension API
ZblLogCategory.h
Go to the documentation of this file.
1 /*
2  * Zuble - A run-time system for QML/Javascript applications
3  * Copyright (C) 2015 Bob Dinitto
4  *
5  * Filename: ZblLogCategory.h
6  * Created on: 4/19/2015
7  * Author: Bob Dinitto
8  *
9  * Zuble is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  */
24 
25 #ifndef ZBLLOGOB_H
26 #define ZBLLOGOB_H
27 
28 #include <QLoggingCategory>
29 #include <QMutex>
30 
31 namespace Zbl
32 {
33 
47 {
48  friend class ZblLogManager;
49  friend class ZblLogWorker;
50 public:
51  explicit ZblLogCategory(const char* logCategory);
52  explicit ZblLogCategory(const QString logCategory);
53 
54  void registerCategory();
55 
56  QLoggingCategory& operator()(){return m_logCategory;}
57 
58  //bool isLogCategoryRegistered(){return m_logCategoryRegistered;}
59 
60 
61 protected:
62 
67  QLoggingCategory m_logCategory;
68 
74 
82  static QStringList m_categories;
83 
88  static QMutex m_categorylock;
89 
90 };
91 
92 } // Zbl
93 
94 
95 #endif // ZBLLOGOB_H
The Zuble Log Manager is a singleton object that controls logging in Zuble applications.
Definition: ZblLogManager.h:70
This class provides a thread-safe log message back end for the Zuble log manager. ...
Definition: ZblLogWorker.h:50
Definition: ZAndGate.cpp:6
static QMutex m_categorylock
Protects thread-safe methods of this class.
static QStringList m_categories
A list of registered log categories.
bool m_categoryRegistered
true if we have already registered this category
Zuble objects embed this class to save local logging state.
QLoggingCategory m_logCategory
A wrapped QLoggingCategory object for this log category.
QLoggingCategory & operator()()
ZblLogCategory(const char *logCategory)