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
Public Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
Zbl::ZblLogCategory Class Reference

Zuble objects embed this class to save local logging state. More...

#include <ZblLogCategory.h>

Public Member Functions

 ZblLogCategory (const char *logCategory)
 
 ZblLogCategory (const QString logCategory)
 
void registerCategory ()
 
QLoggingCategory & operator() ()
 

Protected Attributes

QLoggingCategory m_logCategory
 A wrapped QLoggingCategory object for this log category. More...
 
bool m_categoryRegistered
 true if we have already registered this category More...
 

Static Protected Attributes

static QStringList m_categories
 A list of registered log categories. More...
 
static QMutex m_categorylock
 Protects thread-safe methods of this class. More...
 

Friends

class ZblLogManager
 
class ZblLogWorker
 

Detailed Description

Zuble objects embed this class to save local logging state.

This class wraps QLoggingCategory and provides access to Zuble's log manager object (ZblLogManager). A boolean flag prevents unnecessary log registrations as these require acquiring a mutex.

See also
Zbl::ZblLogManager

Definition at line 46 of file ZblLogCategory.h.

Constructor & Destructor Documentation

◆ ZblLogCategory() [1/2]

Zbl::ZblLogCategory::ZblLogCategory ( const char *  logCategory)
explicit

Definition at line 35 of file ZblLogCategory.cpp.

◆ ZblLogCategory() [2/2]

Zbl::ZblLogCategory::ZblLogCategory ( const QString  logCategory)
explicit

Definition at line 42 of file ZblLogCategory.cpp.

Member Function Documentation

◆ operator()()

QLoggingCategory& Zbl::ZblLogCategory::operator() ( )
inline

Definition at line 56 of file ZblLogCategory.h.

◆ registerCategory()

void Zbl::ZblLogCategory::registerCategory ( )

Friends And Related Function Documentation

◆ ZblLogManager

friend class ZblLogManager
friend

Definition at line 48 of file ZblLogCategory.h.

◆ ZblLogWorker

friend class ZblLogWorker
friend

Definition at line 49 of file ZblLogCategory.h.

Member Data Documentation

◆ m_categories

QStringList Zbl::ZblLogCategory::m_categories
staticprotected

A list of registered log categories.

Zuble maintains this list so that log categories can be enumerated and controlled from QML/javascript programs.

Definition at line 82 of file ZblLogCategory.h.

Referenced by registerCategory().

◆ m_categorylock

QMutex Zbl::ZblLogCategory::m_categorylock
staticprotected

Protects thread-safe methods of this class.

Definition at line 88 of file ZblLogCategory.h.

Referenced by registerCategory().

◆ m_categoryRegistered

bool Zbl::ZblLogCategory::m_categoryRegistered
protected

true if we have already registered this category

Definition at line 73 of file ZblLogCategory.h.

Referenced by registerCategory().

◆ m_logCategory

QLoggingCategory Zbl::ZblLogCategory::m_logCategory
protected

A wrapped QLoggingCategory object for this log category.

Definition at line 67 of file ZblLogCategory.h.

Referenced by operator()(), and registerCategory().


The documentation for this class was generated from the following files: