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
|
This class provides a thread-safe log message back end for the Zuble log manager. More...
#include <ZblLogWorker.h>
Public Slots | |
bool | zInit (const QString &logSource, ZTableModel *logBuffer) |
Initializes the ZblLogWorker object. This method should be called after the ZblLogWorker object has been moved to it's host thread. It should be called only once prior to calling any other methods on this object. More... | |
void | outputLogMessage (QVariant message) |
Outputs a log message to the log histogram buffer and/or a file and/or stdout. More... | |
void | setOutputParameters (QVariant logParams) |
Sets the output parameters for the log worker object. More... | |
Signals | |
void | outputParametersUpdated (QVariant logParams) |
Public Member Functions | |
ZblLogWorker (QObject *parent=0) | |
Protected Member Functions | |
bool | createLogFile () |
void | closeLogFile () |
bool | writeFileInformation (QFile &logFile, QString creationTime, QByteArray creationZone) |
void | outputTextMessage (const ZblLogMessage &msg) |
void | outputJsonMessage (const ZblLogMessage &msg) |
QString | formatTextMessage (const ZblLogMessage &msg) |
Protected Attributes | |
ZblLogParams | m_logParam |
Zuble logging output parameters. More... | |
bool | m_outFileActive |
true if output file object is opened and accepting data, false otherwise. More... | |
QFile | m_outputFile |
The log output file object. More... | |
QTextStream | m_outputStream |
The log output stream object. More... | |
ZTableModel * | m_logBuffer |
Pointer to the log manager's log record histogram buffer. More... | |
quint64 | m_nextRecordNumber |
A running counter to generate log record numbers. More... | |
QString | m_appName |
Application name that will be written to log file. More... | |
QString | m_hostName |
Name of the host executable application. More... | |
int | m_hostVersionMajor |
Major version of the host executable application. More... | |
int | m_hostVersionMinor |
Minor version of the host executable application. More... | |
int | m_hostVersionPatch |
Patch version of the host executable application. More... | |
QString | m_hostVersionBulid |
Build name of the host executable application. More... | |
QString | m_logSource |
String that will be written to the "source" field of the log file. More... | |
Friends | |
class | ZblLogManager |
This class provides a thread-safe log message back end for the Zuble log manager.
It should be created in the main thread and then moved to a background thread. This object serializes logging output by accepting log messages from all threads into a queued connection method. It discards log messages generated by it's own thread to avoid logging loops.
Definition at line 50 of file ZblLogWorker.h.
|
explicit |
Definition at line 52 of file ZblLogWorker.cpp.
|
protected |
Definition at line 183 of file ZblLogWorker.cpp.
Referenced by createLogFile(), outputLogMessage(), and setOutputParameters().
|
protected |
Definition at line 101 of file ZblLogWorker.cpp.
Referenced by setOutputParameters().
|
protected |
Definition at line 334 of file ZblLogWorker.cpp.
Referenced by outputLogMessage(), and outputTextMessage().
|
protected |
Definition at line 367 of file ZblLogWorker.cpp.
Referenced by outputLogMessage().
|
slot |
Outputs a log message to the log histogram buffer and/or a file and/or stdout.
This slot should only be invoked with a Qt::QueuedConnection or Qt::BlockingQueuedConnection connection type to preserve log message serialization. Don't call this method directly.
message | A variant containing a Zbl::ZblLogMessage object |
Definition at line 241 of file ZblLogWorker.cpp.
|
signal |
Referenced by setOutputParameters(), and Zbl::ZblLogManager::zInit().
|
protected |
Definition at line 329 of file ZblLogWorker.cpp.
Referenced by outputLogMessage().
|
slot |
Sets the output parameters for the log worker object.
This slot should only be invoked with a Qt::QueuedConnection connection type to preserve integrity of this object's state machine.
logParams | A QVariant object containing a ZblLogParams object |
Definition at line 298 of file ZblLogWorker.cpp.
|
protected |
Definition at line 195 of file ZblLogWorker.cpp.
Referenced by createLogFile().
|
slot |
Initializes the ZblLogWorker object. This method should be called after the ZblLogWorker object has been moved to it's host thread. It should be called only once prior to calling any other methods on this object.
logFileLocation | Optional path to the directory in which Zuble will create log files. Pass an empty string to use the default location: data://logs |
logBuffer | A pointer to the log histogram buffer to receive log record output |
Definition at line 71 of file ZblLogWorker.cpp.
Referenced by Zbl::ZblLogManager::zInit().
|
friend |
Definition at line 52 of file ZblLogWorker.h.
|
protected |
Application name that will be written to log file.
Definition at line 165 of file ZblLogWorker.h.
Referenced by writeFileInformation(), and zInit().
|
protected |
Name of the host executable application.
Definition at line 171 of file ZblLogWorker.h.
Referenced by writeFileInformation(), and zInit().
|
protected |
Build name of the host executable application.
Definition at line 191 of file ZblLogWorker.h.
Referenced by writeFileInformation(), and zInit().
|
protected |
Major version of the host executable application.
Definition at line 176 of file ZblLogWorker.h.
Referenced by writeFileInformation(), and zInit().
|
protected |
Minor version of the host executable application.
Definition at line 181 of file ZblLogWorker.h.
Referenced by writeFileInformation(), and zInit().
|
protected |
Patch version of the host executable application.
Definition at line 186 of file ZblLogWorker.h.
Referenced by writeFileInformation(), and zInit().
|
protected |
Pointer to the log manager's log record histogram buffer.
Definition at line 151 of file ZblLogWorker.h.
Referenced by outputLogMessage(), and zInit().
|
protected |
Zuble logging output parameters.
Definition at line 127 of file ZblLogWorker.h.
Referenced by createLogFile(), formatTextMessage(), outputLogMessage(), and setOutputParameters().
|
protected |
String that will be written to the "source" field of the log file.
Definition at line 196 of file ZblLogWorker.h.
Referenced by formatTextMessage(), outputJsonMessage(), outputLogMessage(), and zInit().
|
protected |
A running counter to generate log record numbers.
Log record numbers are not guaranteed to be unique or sequential once written to a log file but are highly likely to be.
Definition at line 159 of file ZblLogWorker.h.
Referenced by formatTextMessage(), outputJsonMessage(), and outputLogMessage().
|
protected |
true if output file object is opened and accepting data, false otherwise.
Definition at line 133 of file ZblLogWorker.h.
Referenced by closeLogFile(), createLogFile(), and outputLogMessage().
|
protected |
The log output file object.
Definition at line 139 of file ZblLogWorker.h.
Referenced by closeLogFile(), createLogFile(), and outputJsonMessage().
|
protected |
The log output stream object.
Definition at line 145 of file ZblLogWorker.h.
Referenced by closeLogFile(), createLogFile(), and outputTextMessage().
Zuble documentation copyright © 2019 Bob Dinitto. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Zuble is a derivative work of Qt version 5. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.