mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
refs #336 Convenience methods to create validation messages.
This commit is contained in:
@@ -40,6 +40,27 @@ namespace BlackMisc
|
||||
return *this;
|
||||
}
|
||||
|
||||
CLogMessage &CLogMessage::validationInfo(QString format)
|
||||
{
|
||||
m_categories.remove(CLogCategory::uncategorized());
|
||||
m_categories.push_back(CLogCategory::validation());
|
||||
return info(format);
|
||||
}
|
||||
|
||||
CLogMessage &CLogMessage::validationWarning(QString format)
|
||||
{
|
||||
m_categories.remove(CLogCategory::uncategorized());
|
||||
m_categories.push_back(CLogCategory::validation());
|
||||
return warning(format);
|
||||
}
|
||||
|
||||
CLogMessage &CLogMessage::validationError(QString format)
|
||||
{
|
||||
m_categories.remove(CLogCategory::uncategorized());
|
||||
m_categories.push_back(CLogCategory::validation());
|
||||
return error(format);
|
||||
}
|
||||
|
||||
CLogMessage::operator CStatusMessage()
|
||||
{
|
||||
m_redundant = true;
|
||||
|
||||
@@ -110,6 +110,15 @@ namespace BlackMisc
|
||||
//! Set the severity to error, providing a format string.
|
||||
CLogMessage &error(QString format);
|
||||
|
||||
//! Set the severity to info, providing a format string, and adding the validation category.
|
||||
CLogMessage &validationInfo(QString format);
|
||||
|
||||
//! Set the severity to warning, providing a format string, and adding the validation category.
|
||||
CLogMessage &validationWarning(QString format);
|
||||
|
||||
//! Set the severity to error, providing a format string, and adding the validation category.
|
||||
CLogMessage &validationError(QString format);
|
||||
|
||||
//! Streaming operators.
|
||||
//! \details If the format string is empty, the message will consist of all streamed values separated by spaces.
|
||||
//! Otherwise, the streamed values will replace the place markers %1, %2, %3... in the format string.
|
||||
|
||||
Reference in New Issue
Block a user