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 <ZblLogAgent.h>
Public Slots | |
bool | zInit (const QString &logSource, ZTableModel *logBuffer) |
Initializes the ZblLogAgent object. This method should be called after the ZblLogAgent 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 | |
ZblLogAgent (QObject *parent=nullptr) | |
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... | |
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... | |
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... | |
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... | |
bool | m_outFileActive |
true if output file object is opened and accepting data, false otherwise. 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 ZblLogAgent.h.
|
explicit |
Definition at line 52 of file ZblLogAgent.cpp.
|
protected |
Definition at line 185 of file ZblLogAgent.cpp.
Referenced by createLogFile(), outputLogMessage(), and setOutputParameters().
|
protected |
Definition at line 103 of file ZblLogAgent.cpp.
Referenced by setOutputParameters().
|
protected |
Definition at line 336 of file ZblLogAgent.cpp.
Referenced by outputLogMessage(), and outputTextMessage().
|
protected |
Definition at line 369 of file ZblLogAgent.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 243 of file ZblLogAgent.cpp.
|
signal |
Referenced by setOutputParameters().
|
protected |
Definition at line 331 of file ZblLogAgent.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 300 of file ZblLogAgent.cpp.
|
protected |
Definition at line 197 of file ZblLogAgent.cpp.
Referenced by createLogFile().
|
slot |
Initializes the ZblLogAgent object. This method should be called after the ZblLogAgent 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 ZblLogAgent.cpp.
|
friend |
Definition at line 52 of file ZblLogAgent.h.
|
protected |
Application name that will be written to log file.
Definition at line 167 of file ZblLogAgent.h.
Referenced by writeFileInformation(), and zInit().
|
protected |
Name of the host executable application.
Definition at line 173 of file ZblLogAgent.h.
Referenced by writeFileInformation(), and zInit().
|
protected |
Build name of the host executable application.
Definition at line 178 of file ZblLogAgent.h.
Referenced by writeFileInformation(), and zInit().
|
protected |
Major version of the host executable application.
Definition at line 188 of file ZblLogAgent.h.
Referenced by writeFileInformation(), and zInit().
|
protected |
Minor version of the host executable application.
Definition at line 193 of file ZblLogAgent.h.
Referenced by writeFileInformation(), and zInit().
|
protected |
Patch version of the host executable application.
Definition at line 198 of file ZblLogAgent.h.
Referenced by writeFileInformation(), and zInit().
|
protected |
Pointer to the log manager's log record histogram buffer.
Definition at line 152 of file ZblLogAgent.h.
Referenced by outputLogMessage(), and zInit().
|
protected |
Zuble logging output parameters.
Definition at line 127 of file ZblLogAgent.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 183 of file ZblLogAgent.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 160 of file ZblLogAgent.h.
Referenced by formatTextMessage(), outputJsonMessage(), and outputLogMessage().
|
protected |
true if output file object is opened and accepting data, false otherwise.
Definition at line 204 of file ZblLogAgent.h.
Referenced by closeLogFile(), createLogFile(), and outputLogMessage().
|
protected |
The log output file object.
Definition at line 136 of file ZblLogAgent.h.
Referenced by closeLogFile(), createLogFile(), and outputJsonMessage().
|
protected |
The log output stream object.
Definition at line 144 of file ZblLogAgent.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.