Human readable log category:

* fixed propertyIndex in CStatusMessage
* added method for human readable messages in CStatusMessage
* added typeid based category for classes
* listmodel for staus messages, added column and removed outdated data method
* columns, in class init
This commit is contained in:
Klaus Basan
2014-11-20 17:53:02 +01:00
committed by Roland Winklmeier
parent 6e5e28584f
commit 97e04f8360
8 changed files with 56 additions and 57 deletions

View File

@@ -38,7 +38,8 @@ namespace BlackMisc
//! Properties by index
enum ColumnIndex
{
IndexCategory = BlackMisc::CPropertyIndex::GlobalIndexCStatusMessage,
IndexCategories = BlackMisc::CPropertyIndex::GlobalIndexCStatusMessage,
IndexCategoryHumanReadable,
IndexSeverity,
IndexSeverityAsString,
IndexMessage,
@@ -69,6 +70,9 @@ namespace BlackMisc
//! Message category
const CLogCategoryList &getCategories() const { return this->m_categories; }
//! Human readable category
QString getHumanReadableCategory() const;
//! Message severity
StatusSeverity getSeverity() const { return this->m_severity; }
@@ -127,11 +131,13 @@ namespace BlackMisc
private:
BLACK_ENABLE_TUPLE_CONVERSION(CStatusMessage)
CLogCategoryList m_categories;
StatusSeverity m_severity = SeverityDebug;
QString m_message;
QDateTime m_timestamp = QDateTime::currentDateTimeUtc();
bool m_redundant = false;
StatusSeverity m_severity = SeverityDebug;
QString m_message;
QDateTime m_timestamp = QDateTime::currentDateTimeUtc();
bool m_redundant = false;
mutable QVector<quintptr> m_handledByObjects;
mutable QString m_humanReadableCategory; //!< human readable category cache
};
} // namespace