swift
Public Member Functions | Static Public Member Functions | List of all members
swift::misc::CLogMessage Class Reference

Class for emitting a log message. More...

Inheritance diagram for swift::misc::CLogMessage:
[legend]

Public Member Functions

 CLogMessage ()
 Construct a message with the "uncategorized" category.
 
 CLogMessage (const char *file, int line, const char *function)
 Constructor taking filename, line number, and function name, for uncategorized verbose debug messages.
 
 ~CLogMessage ()
 Destructor. This actually emits the message.
 
 operator CStatusMessage ()
 Convert to CStatusMessage for returning the message directly from the function which generated it.
 
 CMessageBase ()
 Inheriting constructors.
 
 CMessageBase (const CLogCategory &category)
 Inheriting constructors.
 
 CMessageBase (const CLogCategoryList &categories)
 Inheriting constructors.
 
 CMessageBase (const CLogCategoryList &categories, const CLogCategory &extra)
 Inheriting constructors.
 
 CMessageBase (const CLogCategoryList &categories, const CLogCategoryList &extra)
 Inheriting constructors.
 
- Public Member Functions inherited from swift::misc::CMessageBase< CLogMessage >
 CMessageBase ()
 Default constructor.
 
 CMessageBase (const CLogCategory &category)
 Construct a message with some specific category.
 
 CMessageBase (const CLogCategoryList &categories)
 Construct a message with some specific categories.
 
 CMessageBase (const CLogCategoryList &categories, const CLogCategory &extra)
 Construct a message with some specific categories.
 
 CMessageBase (const CLogCategoryList &categories, const CLogCategoryList &extra)
 Construct a message with some specific categories.
 
CLogMessagelog (StatusSeverity s, const char16_t(&m)[N])
 Set the severity and format string.
 
CLogMessagelog (StatusSeverity s, const QString &m)
 Set the severity and format string.
 
CLogMessagedebug ()
 Set the severity to debug.
 
CLogMessagedebug (const char16_t(&format)[N])
 Set the severity to debug, providing a format string.
 
CLogMessagedebug (const QString &format)
 Set the severity to debug, providing a format string.
 
CLogMessageinfo (const char16_t(&format)[N])
 Set the severity to info, providing a format string.
 
CLogMessageinfo (const QString &format)
 Set the severity to info, providing a format string.
 
CLogMessagewarning (const char16_t(&format)[N])
 Set the severity to warning, providing a format string.
 
CLogMessagewarning (const QString &format)
 Set the severity to warning, providing a format string.
 
CLogMessageerror (const char16_t(&format)[N])
 Set the severity to error, providing a format string.
 
CLogMessageerror (const QString &format)
 Set the severity to error, providing a format string.
 
CLogMessagevalidation (StatusSeverity s, const char16_t(&format)[N])
 Set the severity to s, providing a format string, and adding the validation category.
 
CLogMessagevalidation (StatusSeverity s, const QString &format)
 Set the severity to s, providing a format string, and adding the validation category.
 
CLogMessagevalidationInfo (const char16_t(&format)[N])
 Set the severity to info, providing a format string, and adding the validation category.
 
CLogMessagevalidationInfo (const QString &format)
 Set the severity to info, providing a format string, and adding the validation category.
 
CLogMessagevalidationWarning (const char16_t(&format)[N])
 Set the severity to warning, providing a format string, and adding the validation category.
 
CLogMessagevalidationWarning (const QString &format)
 Set the severity to warning, providing a format string, and adding the validation category.
 
CLogMessagevalidationError (const char16_t(&format)[N])
 Set the severity to error, providing a format string, and adding the validation category.
 
CLogMessagevalidationError (const QString &format)
 Set the severity to error, providing a format string, and adding the validation category.
 
CLogMessageoperator<< (T v)
 Streaming operators. More...
 
CLogMessageoperator<< (const T &v)
 Streaming operators. More...
 
bool isEmpty () const
 Message empty.
 
CLogMessagelog (StatusSeverity, const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
 
CLogMessagedebug (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
 
CLogMessageinfo (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
 
CLogMessagewarning (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
 
CLogMessageerror (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
 
CLogMessagevalidation (StatusSeverity, const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
 
CLogMessagevalidationInfo (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
 
CLogMessagevalidationWarning (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
 
CLogMessagevalidationError (const char *)=delete
 Deleted methods to avoid accidental implicit conversion from Latin-1 or UTF-8 string literals.
 

Static Public Member Functions

static void preformatted (const CStatusMessage &statusMessage)
 Sends a verbatim, preformatted message to the log.
 
static void preformatted (const CStatusMessageList &statusMessages)
 Sends a list of verbatim, preformatted messages to the log.
 

Additional Inherited Members

- Protected Member Functions inherited from swift::misc::CMessageBase< CLogMessage >
void addIfNotExisting (const CLogCategory &category)
 Add category if not already existing.
 
void addIfNotExisting (const CLogCategoryList &categories)
 Add categories if not already existing.
 
QString message () const
 Private.
 
- Protected Attributes inherited from swift::misc::CMessageBase< CLogMessage >
CStrongStringView m_message
 Private.
 
QStringList m_args
 Private.
 
CLogCategoryList m_categories
 Private.
 
StatusSeverity m_severity
 Private.
 

Detailed Description

Class for emitting a log message.

Works similar to the qDebug, qWarning, qCritical family of functions.

The member functions debug, info, warning, error, and the stream operators all return a reference to *this, so they can be chained together.

The categories are arbitrary string tags which can be attached to the message to categorize it. A message can have more than one category. The categories can be used for filtering by message handlers.

Definition at line 26 of file logmessage.h.


The documentation for this class was generated from the following file: