mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 05:51:23 +08:00
refs #350 CStatusMessage methods for adding extra log categories.
This commit is contained in:
@@ -105,6 +105,12 @@ namespace BlackMisc
|
|||||||
//! Severity
|
//! Severity
|
||||||
void setSeverity(StatusSeverity severity) { this->m_severity = severity; }
|
void setSeverity(StatusSeverity severity) { this->m_severity = severity; }
|
||||||
|
|
||||||
|
//! Add category
|
||||||
|
void addCategory(const CLogCategory &category) { this->m_categories.push_back(category); }
|
||||||
|
|
||||||
|
//! Add categories
|
||||||
|
void addCategories(const CLogCategoryList &categories) { this->m_categories.push_back(categories); }
|
||||||
|
|
||||||
//! Representing icon
|
//! Representing icon
|
||||||
virtual CIcon toIcon() const override { return convertToIcon(*this); }
|
virtual CIcon toIcon() const override { return convertToIcon(*this); }
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,28 @@ namespace BlackMisc
|
|||||||
return this->findBy(&CStatusMessage::getSeverity, severity);
|
return this->findBy(&CStatusMessage::getSeverity, severity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add category
|
||||||
|
*/
|
||||||
|
void CStatusMessageList::addCategory(const CLogCategory &category)
|
||||||
|
{
|
||||||
|
for (auto &msg : *this)
|
||||||
|
{
|
||||||
|
msg.addCategory(category);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add categories
|
||||||
|
*/
|
||||||
|
void CStatusMessageList::addCategories(const CLogCategoryList &categories)
|
||||||
|
{
|
||||||
|
for (auto &msg : *this)
|
||||||
|
{
|
||||||
|
msg.addCategories(categories);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Metadata
|
* Metadata
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -38,6 +38,12 @@ namespace BlackMisc
|
|||||||
//! Find by severity
|
//! Find by severity
|
||||||
CStatusMessageList findBySeverity(CStatusMessage::StatusSeverity severity) const;
|
CStatusMessageList findBySeverity(CStatusMessage::StatusSeverity severity) const;
|
||||||
|
|
||||||
|
//! Add a category to all messages in the list
|
||||||
|
void addCategory(const CLogCategory &category);
|
||||||
|
|
||||||
|
//! Add some categories to all messages in the list
|
||||||
|
void addCategories(const CLogCategoryList &categories);
|
||||||
|
|
||||||
//! \copydoc CValueObject::toQVariant
|
//! \copydoc CValueObject::toQVariant
|
||||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user