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

The Zuble Log Manager is a singleton object that controls logging in Zuble applications. More...

#include <ZblLogManager.h>

Inheritance diagram for Zbl::ZblLogManager:
Inheritance graph
[legend]
Collaboration diagram for Zbl::ZblLogManager:
Collaboration graph
[legend]

Public Types

enum  logFields {
  LogFieldRecordNum = 0, LogFieldCategory = 1, LogFieldSource = 2, LogFieldMessage = 3,
  LogFieldFunction = 4, LogFieldLine = 5, LogFieldFile = 6, LogFieldMark = 7
}
 Roles for the log record data model. More...
 
enum  ruleFields {
  RuleCategory = 0, RuleRegistered = 1, RuleSaved = 2, RuleEnabled = 3,
  RuleWarning = 4, RuleCritical = 5, RuleDebug = 6
}
 Roles for the logging rules data model. More...
 

Public Slots

bool registerLogCategory (const QString logCategory)
 Adds the specified log category to the registered log category list. More...
 
void onLogProfileModified (const QString &path)
 Responds to changes to the current log settings by replacing the log profile with the current log settings. More...
 
void onZubleSettingsModified (const QString &path)
 Responds to changes in the Zuble application settingsby updating log manager's internal state. @ param path. More...
 
void onLogWorkerOutputParametersUpdated (QVariant logParams)
 Synchronizes log manager and log worker output parameters. More...
 
void onSettingsBundleAvailable (QString bundleId)
 Responds to newly loaded settings bundles. More...
 
bool loadFilterRules (const QString &logProfileBundleID)
 Loades the log filter rules from the specified log profile into the log rule model. More...
 
void onRuleModelModified (int dataRole, int rowNumber)
 Responds to changes in the rule model by updating Qt's internal rule model and the current log settings file. More...
 
void saveFilterRules ()
 Saves the current state of the logging rules data model to the current log profile. More...
 
void populateRegisteredRules ()
 Appends all log categories that have so far been registered with a call to ZblLogManager::registerLogCategory() to the logging rules data model. More...
 
bool appendRuleModelCategory (const QString &logCategory)
 Adds a new category to the rule model. If the category already exists in the rule model the request to add is ignored. More...
 

Public Member Functions

 ZblLogManager (QObject *parent=0)
 
virtual ~ZblLogManager ()
 
Q_INVOKABLE QObject * getLogBuffer ()
 Obtain the log buffer data model. More...
 
Q_INVOKABLE int getLogBufferRoleCount ()
 Obtain the number of roles in the log buffer data model. More...
 
Q_INVOKABLE QObject * getLogRules ()
 Obtain the logging rules data model. More...
 
virtual void timerEvent (QTimerEvent *event)
 Timer is used to flush excess log records from the log record buffer. More...
 
ZTableModelcreateLogBufferModel (QObject *parent=NULL)
 Creates a new log record data model by appending the appropriate data rules. The caller assumes ownership of the data model. More...
 

Static Public Member Functions

static ZblLogManagerzInit (QObject *parent)
 Construct, initialize and obtain a reference to Zuble's log manager object. More...
 
static ZblLogManagerzInstance ()
 Obtain a reference to Zuble's log manager object. More...
 

Protected Member Functions

ZBL_DECLARE_LOGGED_OBJECT QString getQtLogRule (const QString &category, const QString &level, bool enabled)
 Returns a Qt logging rule string for the given log category and level. More...
 
QString getQtLogRulesForRow (int rowNumber)
 Returns a Qt logging rule string for all logging levels for the specified row (log category) in the logging rules data model. More...
 
void setQtLogRulesFromModel ()
 Sets Qt's internal logging rules from data contained in log manager's logging rules model. More...
 
bool createRuleModel ()
 Creates the log manager's log rules data model and initializes associated variables used to optimize performance of adding rules to the model, then connects log manager to appropriate rule model signals. This method should only be called once. More...
 
bool isCommandLineLogging ()
 Returns true if -zl option is passed in on command line. More...
 
bool startLogThread ()
 Starts log manager's background thread. More...
 
void stopLogThread ()
 Stops log manager's background thread. More...
 
bool populateMetaRules ()
 Appends all log categories defined in the Zuble application's zblconfig.xml configuration file to the logging rules data model. More...
 
void setApplicationObject (ZApplication *appObject)
 Connects the log manager to appropriate Zuble core plugin signals and attempts to load the current log profile if one is available. This method should be called only once. More...
 
void updateApplicationSettings ()
 
void updateLogProfileSettings ()
 Loads a new copy of the log profile settings from the settings file. More...
 
bool loadCurrentLogProfile ()
 Replaces the current log settings with those from the specified file. More...
 
void setLogOutputParameters ()
 Gathers the application and log profile settings that affect log output and synchronizes those parameters with the ZblLogWorker object. More...
 

Static Protected Member Functions

static QString createTemporaryLogProfile (const QString &nameTemplate, bool remove=false)
 Creates an empty file with a unique file name in the log profile directory. More...
 
static QString getLogSettingsMetadata ()
 Returns an xml data structure that defines the zuble application's log settings. More...
 
static LogFileFormat fileFormatFromString (const QString &logFileFormat)
 

Static Protected Attributes

static const QString m_currentLogSettingsBundleId = "current-log-profile"
 The bundle ID for the current logging profile = "current-log-profile". More...
 
static const QString m_zubleSettingsBundleId = "default"
 The bundle ID for the zuble application settings = "default". More...
 
static const QString m_defaultOutputFilePath = ""
 TBD: currently unused! More...
 

Static Private Member Functions

static void zMessageHandler (QtMsgType msgType, const QMessageLogContext &logCtx, const QString &text)
 Zuble's Qt message handler. More...
 

Private Attributes

ZblLogParams m_logParam
 Current Zuble logging parameters. More...
 
int m_timerID
 ID for the log manager's event timer. More...
 
ZTableModelm_logBuffer
 Zuble's log buffer provides a viewable record of recent log activity. More...
 
ZRoleNames m_bufferRoles
 A hash of log buffer column numbers to column field names. More...
 
QThread m_logThread
 A background thread to handle logging rules and log record output. More...
 
ZblLogWorkerm_logWorker
 A background thread worker object to handle logging rules and log record output. More...
 
ZTableModelm_logRules
 A data model containing the current logging rules in effect for each known log category. More...
 
ZDataRow m_modelCategoryRow
 A data row to use as a template for constructing role rows. More...
 
ZDataRow m_modelBooleanRow
 A data row to use as a template for constructing role rows. More...
 
ZRoleRow m_modelRoleRow
 A role row to use as a template for adding logging rules to the rule model. More...
 
ZSettingsm_logSettings
 A ZSettings object to track the application settings for changes that control Zuble logging. More...
 
ZSettingsm_profileSettings
 A ZSettings object to track the current log profile for changes to the profile settings. More...
 
bool m_syncProfiles
 true if all application instances update the same log profile, false if each instance updates a separate copy of the log profile. More...
 
bool m_loadingProfile
 true when log manager is currently loading a log profile, false otherwise More...
 
QString m_LogSource
 String inserted into the "source" field of log records. More...
 
QtMessageHandler m_originalMsgHandler
 Pointer to the original (non-Zuble) message handler, or nullptr if Zuble logging has not yet been enabled for the first time. More...
 

Static Private Attributes

static ZblLogManagerm_zLog = nullptr
 The one and only ZblLogManager object in this process. More...
 
static const QString m_logFilterRulesKey = "log-filter-rules"
 The log filter rules key = "log-filter-rules". More...
 
static int m_maxBufferSize = 1000
 The number of logging records the circular log buffer will attempt to hold. More...
 
static const QString m_profileMetadata
 Log profile metadata defines logger settings that are stored in a log profile. More...
 
static const int m_logBufRoleCount = 7
 The number of roles contained in a log file record. More...
 

Friends

class Zblcore
 
class ZblLogCategory
 
class ZblLogWorker
 

Detailed Description

The Zuble Log Manager is a singleton object that controls logging in Zuble applications.

Log Manager maintains a list of log categories that can be enumerated and controlled from QML/javascript programs. The Qt/QML default message handler is replaced with log manager's own internal message handler.

Log Manager converts log messages received from Qt into log records. A log record is an array of QVariant objects that represents a row in a data model. The log manager optionally maintains a circular log buffer that contains a list of the most recent log records.

Use of the log message handler, log buffer and log file are optional. The log manager is turned off by default and must be enabled by one of the following methods:

methods TBD

Definition at line 70 of file ZblLogManager.h.

Member Enumeration Documentation

◆ logFields

Roles for the log record data model.

Enumerator
LogFieldRecordNum 
LogFieldCategory 
LogFieldSource 
LogFieldMessage 
LogFieldFunction 
LogFieldLine 
LogFieldFile 
LogFieldMark 

Definition at line 89 of file ZblLogManager.h.

◆ ruleFields

Roles for the logging rules data model.

Enumerator
RuleCategory 
RuleRegistered 
RuleSaved 
RuleEnabled 
RuleWarning 
RuleCritical 
RuleDebug 

Definition at line 105 of file ZblLogManager.h.

Constructor & Destructor Documentation

◆ ZblLogManager()

Zbl::ZblLogManager::ZblLogManager ( QObject *  parent = 0)
explicit

Definition at line 182 of file ZblLogManager.cpp.

Referenced by zInit().

◆ ~ZblLogManager()

Zbl::ZblLogManager::~ZblLogManager ( )
virtual

Definition at line 204 of file ZblLogManager.cpp.

Member Function Documentation

◆ appendRuleModelCategory

bool Zbl::ZblLogManager::appendRuleModelCategory ( const QString &  logCategory)
slot

Adds a new category to the rule model. If the category already exists in the rule model the request to add is ignored.

Parameters
logCategoryname of the log category to add.
Returns
true if the category was added, false if the category already exists

Definition at line 1019 of file ZblLogManager.cpp.

Referenced by populateRegisteredRules(), and Zbl::ZblLogCategory::registerCategory().

◆ createLogBufferModel()

ZTableModel * Zbl::ZblLogManager::createLogBufferModel ( QObject *  parent = NULL)

Creates a new log record data model by appending the appropriate data rules. The caller assumes ownership of the data model.

Parameters
parentThe object that will become the parent of the data model or null (default) if ZblLogManager object should be the parent.
Returns
A ZTableModel object with log record data rules

Definition at line 704 of file ZblLogManager.cpp.

Referenced by zInit().

◆ createRuleModel()

bool Zbl::ZblLogManager::createRuleModel ( )
protected

Creates the log manager's log rules data model and initializes associated variables used to optimize performance of adding rules to the model, then connects log manager to appropriate rule model signals. This method should only be called once.

Returns
true if rule model created, false if this method has already been called before

Definition at line 967 of file ZblLogManager.cpp.

Referenced by zInit().

◆ createTemporaryLogProfile()

QString Zbl::ZblLogManager::createTemporaryLogProfile ( const QString &  nameTemplate,
bool  remove = false 
)
staticprotected

Creates an empty file with a unique file name in the log profile directory.

Creates the log profile directory if it doesn't already exist. QTemporaryFile is used to create the file.

Parameters
nameTemplateA name template to use when building the temporary file name.
removeRemoves the temporary file after creation when true. Default is false.
Returns
Path to the newly created empty file.

Definition at line 463 of file ZblLogManager.cpp.

Referenced by loadCurrentLogProfile().

◆ fileFormatFromString()

LogFileFormat Zbl::ZblLogManager::fileFormatFromString ( const QString &  logFileFormat)
staticprotected

Definition at line 1103 of file ZblLogManager.cpp.

Referenced by setLogOutputParameters().

◆ getLogBuffer()

QObject * Zbl::ZblLogManager::getLogBuffer ( )

Obtain the log buffer data model.

Returns
A ZTableModel object containing Zuble's log event records.

Definition at line 645 of file ZblLogManager.cpp.

Referenced by Zbl::ZblApp::getLogBuffer().

◆ getLogBufferRoleCount()

int Zbl::ZblLogManager::getLogBufferRoleCount ( )

Obtain the number of roles in the log buffer data model.

Returns
The number of roles each log record contains.

Definition at line 650 of file ZblLogManager.cpp.

◆ getLogRules()

QObject * Zbl::ZblLogManager::getLogRules ( )

Obtain the logging rules data model.

Modifying the data model will cause log manager to make corresponding modifications to Qt's internal logging data structures.

Returns
The ZTableModel object containing Zuble's logging rules

Definition at line 656 of file ZblLogManager.cpp.

Referenced by Zbl::ZblApp::getLogRules().

◆ getLogSettingsMetadata()

QString Zbl::ZblLogManager::getLogSettingsMetadata ( )
staticprotected

Returns an xml data structure that defines the zuble application's log settings.

These settings control whether the Zuble log manager handles Qt log messages and what log profile should be used to initialize and update Zuble's log manager state. The XML metadata defines the settings themselves. The data for the settings is stored separately in JSON files.

See also
Zbl::ZSettings
Returns
A string containing the XML log settings metadata.

Definition at line 372 of file ZblLogManager.cpp.

Referenced by loadCurrentLogProfile().

◆ getQtLogRule()

QString Zbl::ZblLogManager::getQtLogRule ( const QString &  category,
const QString &  level,
bool  enabled 
)
protected

Returns a Qt logging rule string for the given log category and level.

Parameters
categoryThe log category name for the rule string. WARNING: it must not contain dot (".")!<—Warning: that might be a lie! buwahahaha!
levelThe log level, one of either "warning", "critical", or "debug".
enabledtrue to return a rule string that enables the category/level, false to return a rule string that disables the category/level
Returns
A Qt logging filter rule string suitable for passing to QLoggingCategory::setFilterRules()

Definition at line 947 of file ZblLogManager.cpp.

Referenced by getQtLogRulesForRow().

◆ getQtLogRulesForRow()

QString Zbl::ZblLogManager::getQtLogRulesForRow ( int  rowNumber)
protected

Returns a Qt logging rule string for all logging levels for the specified row (log category) in the logging rules data model.

Parameters
rowNumberThe row in the data model for which a logging rules string will be concatenated. Each row contains the rules for all levels of a single logging category.

Definition at line 929 of file ZblLogManager.cpp.

Referenced by setQtLogRulesFromModel().

◆ isCommandLineLogging()

bool Zbl::ZblLogManager::isCommandLineLogging ( )
protected

Returns true if -zl option is passed in on command line.

Returns
true if "-zl" option found on command line, false otherwise

Definition at line 507 of file ZblLogManager.cpp.

◆ loadCurrentLogProfile()

bool Zbl::ZblLogManager::loadCurrentLogProfile ( )
protected

Replaces the current log settings with those from the specified file.

Parameters
logProfilePathThe path to the log profile to load
Returns
true if success, false otherwise

Definition at line 400 of file ZblLogManager.cpp.

Referenced by onSettingsBundleAvailable(), onZubleSettingsModified(), and setApplicationObject().

◆ loadFilterRules

bool Zbl::ZblLogManager::loadFilterRules ( const QString &  logProfileBundleID)
slot

Loades the log filter rules from the specified log profile into the log rule model.

Parameters
logProfileBundleIDThe bundle ID for the log profile
Returns
true if loading successful, false otherwise

Definition at line 888 of file ZblLogManager.cpp.

Referenced by loadCurrentLogProfile(), and zInit().

◆ onLogProfileModified

void Zbl::ZblLogManager::onLogProfileModified ( const QString &  path)
slot

Responds to changes to the current log settings by replacing the log profile with the current log settings.

Parameters
path

Definition at line 773 of file ZblLogManager.cpp.

Referenced by updateLogProfileSettings().

◆ onLogWorkerOutputParametersUpdated

void Zbl::ZblLogManager::onLogWorkerOutputParametersUpdated ( QVariant  logParams)
slot

Synchronizes log manager and log worker output parameters.

Log manager doesn't set it's internal log output parameters or enable its log message handler until log worker object has been set up to receive log records. Since these objects are in different threads we use the ZblLogWorker::outputParametersUpdated signal to ensure the log worker is ready to accept log output before switching to Zuble's log message handler.

Parameters
enableLogging
logOutputDir
enableModel
enableFile
fileType

Definition at line 821 of file ZblLogManager.cpp.

Referenced by zInit().

◆ onRuleModelModified

void Zbl::ZblLogManager::onRuleModelModified ( int  dataRole,
int  rowNumber 
)
slot

Responds to changes in the rule model by updating Qt's internal rule model and the current log settings file.

Parameters
dataRole
rowNumber

Definition at line 1044 of file ZblLogManager.cpp.

Referenced by createRuleModel().

◆ onSettingsBundleAvailable

void Zbl::ZblLogManager::onSettingsBundleAvailable ( QString  bundleId)
slot

Responds to newly loaded settings bundles.

Parameters
bundleIdthe settings bundle that was recently loaded

Definition at line 314 of file ZblLogManager.cpp.

Referenced by setApplicationObject().

◆ onZubleSettingsModified

void Zbl::ZblLogManager::onZubleSettingsModified ( const QString &  path)
slot

Responds to changes in the Zuble application settingsby updating log manager's internal state. @ param path.

Definition at line 848 of file ZblLogManager.cpp.

Referenced by updateApplicationSettings().

◆ populateMetaRules()

bool Zbl::ZblLogManager::populateMetaRules ( )
protected

Appends all log categories defined in the Zuble application's zblconfig.xml configuration file to the logging rules data model.

TBD: this function currently an unimplemented stub. sry....

Returns

Definition at line 877 of file ZblLogManager.cpp.

◆ populateRegisteredRules

void Zbl::ZblLogManager::populateRegisteredRules ( )
slot

Appends all log categories that have so far been registered with a call to ZblLogManager::registerLogCategory() to the logging rules data model.

Definition at line 1081 of file ZblLogManager.cpp.

Referenced by zInit().

◆ registerLogCategory

bool Zbl::ZblLogManager::registerLogCategory ( const QString  logCategory)
slot

Adds the specified log category to the registered log category list.

Parameters
logCategorythe name of the log category to add. Duplicates are silently ignored
Returns
true if the name was added, false if the name was already present in the list

Definition at line 674 of file ZblLogManager.cpp.

◆ saveFilterRules

void Zbl::ZblLogManager::saveFilterRules ( )
slot

Saves the current state of the logging rules data model to the current log profile.

test

end test

Definition at line 1059 of file ZblLogManager.cpp.

Referenced by loadCurrentLogProfile(), onRuleModelModified(), and populateRegisteredRules().

◆ setApplicationObject()

void Zbl::ZblLogManager::setApplicationObject ( ZApplication appObject)
protected

Connects the log manager to appropriate Zuble core plugin signals and attempts to load the current log profile if one is available. This method should be called only once.

Parameters
appObjectZuble core plugin's ZApplication object.

Definition at line 291 of file ZblLogManager.cpp.

◆ setLogOutputParameters()

void Zbl::ZblLogManager::setLogOutputParameters ( )
protected

Gathers the application and log profile settings that affect log output and synchronizes those parameters with the ZblLogWorker object.

See also
ZblLogWorker::setOutputParameters()

Definition at line 781 of file ZblLogManager.cpp.

Referenced by onLogProfileModified(), onZubleSettingsModified(), and updateLogProfileSettings().

◆ setQtLogRulesFromModel()

void Zbl::ZblLogManager::setQtLogRulesFromModel ( )
protected

Sets Qt's internal logging rules from data contained in log manager's logging rules model.

Definition at line 953 of file ZblLogManager.cpp.

Referenced by loadFilterRules(), and onRuleModelModified().

◆ startLogThread()

bool Zbl::ZblLogManager::startLogThread ( )
protected

Starts log manager's background thread.

Returns
true if background thread was started, false if background thread was already running.

Definition at line 738 of file ZblLogManager.cpp.

Referenced by zInit().

◆ stopLogThread()

void Zbl::ZblLogManager::stopLogThread ( )
protected

Stops log manager's background thread.

Definition at line 764 of file ZblLogManager.cpp.

Referenced by zMessageHandler(), and ~ZblLogManager().

◆ timerEvent()

void Zbl::ZblLogManager::timerEvent ( QTimerEvent *  event)
virtual

Timer is used to flush excess log records from the log record buffer.

Parameters
event

Definition at line 635 of file ZblLogManager.cpp.

◆ updateApplicationSettings()

void Zbl::ZblLogManager::updateApplicationSettings ( )
protected

Definition at line 334 of file ZblLogManager.cpp.

Referenced by onSettingsBundleAvailable(), and setApplicationObject().

◆ updateLogProfileSettings()

void Zbl::ZblLogManager::updateLogProfileSettings ( )
protected

Loads a new copy of the log profile settings from the settings file.

Definition at line 352 of file ZblLogManager.cpp.

Referenced by loadCurrentLogProfile().

◆ zInit()

ZblLogManager & Zbl::ZblLogManager::zInit ( QObject *  parent)
static

Construct, initialize and obtain a reference to Zuble's log manager object.

Returns
a reference to the one and only instance of ZblLogManager

Definition at line 212 of file ZblLogManager.cpp.

◆ zInstance()

ZblLogManager & Zbl::ZblLogManager::zInstance ( )
static

Obtain a reference to Zuble's log manager object.

Returns
a reference to the one and only instance of ZblLogManager

Definition at line 570 of file ZblLogManager.cpp.

Referenced by Zbl::ZblApp::getLogBuffer(), and Zbl::ZblApp::getLogRules().

◆ zMessageHandler()

void Zbl::ZblLogManager::zMessageHandler ( QtMsgType  msgType,
const QMessageLogContext &  logCtx,
const QString &  text 
)
staticprivate

Zuble's Qt message handler.

Parameters
msgTypeThe type of message being sent.
logCtxProvides information about the message source.
textThe message text

Definition at line 581 of file ZblLogManager.cpp.

Referenced by isCommandLineLogging(), and onLogWorkerOutputParametersUpdated().

Friends And Related Function Documentation

◆ Zblcore

friend class Zblcore
friend

Definition at line 72 of file ZblLogManager.h.

◆ ZblLogCategory

friend class ZblLogCategory
friend

Definition at line 73 of file ZblLogManager.h.

◆ ZblLogWorker

friend class ZblLogWorker
friend

Definition at line 74 of file ZblLogManager.h.

Referenced by zInit().

Member Data Documentation

◆ m_bufferRoles

ZRoleNames Zbl::ZblLogManager::m_bufferRoles
private

A hash of log buffer column numbers to column field names.

Definition at line 541 of file ZblLogManager.h.

◆ m_currentLogSettingsBundleId

const QString Zbl::ZblLogManager::m_currentLogSettingsBundleId = "current-log-profile"
staticprotected

The bundle ID for the current logging profile = "current-log-profile".

This bundle ID is used by the log manager to save and restore the current state of the log manager settings. WARNING: this bundle ID is reserved for use by Zuble!

Definition at line 482 of file ZblLogManager.h.

Referenced by loadCurrentLogProfile(), onSettingsBundleAvailable(), saveFilterRules(), updateLogProfileSettings(), and zInit().

◆ m_defaultOutputFilePath

const QString Zbl::ZblLogManager::m_defaultOutputFilePath = ""
staticprotected

TBD: currently unused!

Definition at line 496 of file ZblLogManager.h.

◆ m_loadingProfile

bool Zbl::ZblLogManager::m_loadingProfile
private

true when log manager is currently loading a log profile, false otherwise

Definition at line 644 of file ZblLogManager.h.

Referenced by loadCurrentLogProfile().

◆ m_logBuffer

ZTableModel* Zbl::ZblLogManager::m_logBuffer
private

Zuble's log buffer provides a viewable record of recent log activity.

Definition at line 535 of file ZblLogManager.h.

Referenced by getLogBuffer(), timerEvent(), and zInit().

◆ m_logBufRoleCount

const int Zbl::ZblLogManager::m_logBufRoleCount = 7
staticprivate

The number of roles contained in a log file record.

Definition at line 628 of file ZblLogManager.h.

Referenced by createLogBufferModel(), and getLogBufferRoleCount().

◆ m_logFilterRulesKey

const QString Zbl::ZblLogManager::m_logFilterRulesKey = "log-filter-rules"
staticprivate

The log filter rules key = "log-filter-rules".

This key is used by log manager to store the logging category filter rules in log profiles.

Definition at line 587 of file ZblLogManager.h.

Referenced by loadCurrentLogProfile(), loadFilterRules(), and saveFilterRules().

◆ m_logParam

ZblLogParams Zbl::ZblLogManager::m_logParam
private

Current Zuble logging parameters.

Definition at line 515 of file ZblLogManager.h.

Referenced by onLogWorkerOutputParametersUpdated(), and setLogOutputParameters().

◆ m_logRules

ZTableModel* Zbl::ZblLogManager::m_logRules
private

A data model containing the current logging rules in effect for each known log category.

Definition at line 563 of file ZblLogManager.h.

Referenced by appendRuleModelCategory(), createRuleModel(), getLogRules(), getQtLogRulesForRow(), loadFilterRules(), onZubleSettingsModified(), populateRegisteredRules(), saveFilterRules(), and setQtLogRulesFromModel().

◆ m_logSettings

ZSettings* Zbl::ZblLogManager::m_logSettings
private

A ZSettings object to track the application settings for changes that control Zuble logging.

Definition at line 595 of file ZblLogManager.h.

Referenced by loadCurrentLogProfile(), onZubleSettingsModified(), setLogOutputParameters(), updateApplicationSettings(), and ~ZblLogManager().

◆ m_LogSource

QString Zbl::ZblLogManager::m_LogSource
private

String inserted into the "source" field of log records.

Definition at line 650 of file ZblLogManager.h.

Referenced by zInit().

◆ m_logThread

QThread Zbl::ZblLogManager::m_logThread
private

A background thread to handle logging rules and log record output.

Definition at line 548 of file ZblLogManager.h.

Referenced by startLogThread(), stopLogThread(), zInit(), and zMessageHandler().

◆ m_logWorker

ZblLogWorker* Zbl::ZblLogManager::m_logWorker
private

A background thread worker object to handle logging rules and log record output.

Definition at line 555 of file ZblLogManager.h.

Referenced by setLogOutputParameters(), zInit(), and zMessageHandler().

◆ m_maxBufferSize

int Zbl::ZblLogManager::m_maxBufferSize = 1000
staticprivate

The number of logging records the circular log buffer will attempt to hold.

The log buffer is periodically truncated to this size but may temporarily grow larger depending on logging frequency.

Definition at line 615 of file ZblLogManager.h.

Referenced by timerEvent().

◆ m_modelBooleanRow

ZDataRow Zbl::ZblLogManager::m_modelBooleanRow
private

A data row to use as a template for constructing role rows.

Definition at line 573 of file ZblLogManager.h.

Referenced by createRuleModel().

◆ m_modelCategoryRow

ZDataRow Zbl::ZblLogManager::m_modelCategoryRow
private

A data row to use as a template for constructing role rows.

Definition at line 568 of file ZblLogManager.h.

Referenced by appendRuleModelCategory(), and createRuleModel().

◆ m_modelRoleRow

ZRoleRow Zbl::ZblLogManager::m_modelRoleRow
private

A role row to use as a template for adding logging rules to the rule model.

Definition at line 579 of file ZblLogManager.h.

Referenced by appendRuleModelCategory(), and createRuleModel().

◆ m_originalMsgHandler

QtMessageHandler Zbl::ZblLogManager::m_originalMsgHandler
private

Pointer to the original (non-Zuble) message handler, or nullptr if Zuble logging has not yet been enabled for the first time.

Definition at line 657 of file ZblLogManager.h.

◆ m_profileMetadata

const QString Zbl::ZblLogManager::m_profileMetadata
staticprivate

Log profile metadata defines logger settings that are stored in a log profile.

Definition at line 622 of file ZblLogManager.h.

Referenced by getLogSettingsMetadata().

◆ m_profileSettings

ZSettings* Zbl::ZblLogManager::m_profileSettings
private

A ZSettings object to track the current log profile for changes to the profile settings.

Definition at line 603 of file ZblLogManager.h.

Referenced by loadCurrentLogProfile(), setLogOutputParameters(), and updateLogProfileSettings().

◆ m_syncProfiles

bool Zbl::ZblLogManager::m_syncProfiles
private

true if all application instances update the same log profile, false if each instance updates a separate copy of the log profile.

This allows decoupling of the log settings for separate app instances.

Definition at line 638 of file ZblLogManager.h.

Referenced by loadCurrentLogProfile(), and onZubleSettingsModified().

◆ m_timerID

int Zbl::ZblLogManager::m_timerID
private

ID for the log manager's event timer.

Definition at line 526 of file ZblLogManager.h.

Referenced by isCommandLineLogging(), and timerEvent().

◆ m_zLog

ZblLogManager * Zbl::ZblLogManager::m_zLog = nullptr
staticprivate

The one and only ZblLogManager object in this process.

Definition at line 521 of file ZblLogManager.h.

Referenced by createLogBufferModel(), isCommandLineLogging(), Zbl::ZblLogCategory::registerCategory(), zInit(), zInstance(), and zMessageHandler().

◆ m_zubleSettingsBundleId

const QString Zbl::ZblLogManager::m_zubleSettingsBundleId = "default"
staticprotected

The bundle ID for the zuble application settings = "default".

This bundle ID is used by the log manager to obtain application settings that control the log manager. WARNING: this bundle ID is reserved for use by Zuble!

Definition at line 491 of file ZblLogManager.h.

Referenced by isCommandLineLogging(), onSettingsBundleAvailable(), setApplicationObject(), and updateApplicationSettings().


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