Mixin base class providing categorized logging at four nesting levels.
More...
#include <loggingbaseclass.h>
|
| Log::LogCategory | LVL0 () const |
| | Return the base (level 0) log category.
|
| |
| Log::LogCategory | LVL1 () const |
| | Return the level-1 sub-category.
|
| |
| Log::LogCategory | LVL2 () const |
| | Return the level-2 sub-category.
|
| |
| Log::LogCategory | LVL3 () const |
| | Return the level-3 sub-category.
|
| |
| void | logText (const char *file, int lineNumber, Log::LogLevel level, const QString &text) const |
| | Write a text message to the system logger using the base category.
|
| |
| void | logText (const char *file, int lineNumber, Log::LogLevel level, const Log::LogCategory &category, const QString &text) const |
| | Write a text message to the system logger using an explicit category.
|
| |
| void | logHex (const char *file, int lineNumber, Log::LogLevel level, const QByteArray &data, const QString &tag=QString()) const |
| | Write a hex dump to the system logger.
|
| |
| void | logHex (const char *file, int lineNumber, Log::LogLevel level, const Log::LogCategory &category, const QByteArray &data, const QString &tag=QString()) const |
| | Write a hex dump to the system logger using an explicit category.
|
| |
| void | addLogConsumer (LogConsumer *consumer) |
| | Register an external log consumer to receive entries from this class.
|
| |
| void | removeLogConsumer (LogConsumer *consumer) |
| | Remove a previously added log consumer.
|
| |
Mixin base class providing categorized logging at four nesting levels.
Classes that inherit LoggingBaseClass gain logText() and logHex() methods that automatically tag messages with the registered log category. The category can be refined into up to three sub-levels (LVL1, LVL2, LVL3) for more granular filtering.
Definition at line 23 of file loggingbaseclass.h.
◆ LoggingBaseClass() [1/2]
Construct with an optional log category.
- Parameters
-
| category | Base log category (default: uncategorized) |
◆ LoggingBaseClass() [2/2]
| LoggingBaseClass::LoggingBaseClass |
( |
const QString & |
category | ) |
|
Construct with a category name string.
- Parameters
-
| category | Category name string |
◆ addLogConsumer()
| void LoggingBaseClass::addLogConsumer |
( |
LogConsumer * |
consumer | ) |
|
|
protected |
Register an external log consumer to receive entries from this class.
- Parameters
-
◆ logCategory()
Return the base log category.
- Returns
- Base LogCategory
Definition at line 42 of file loggingbaseclass.h.
◆ logHex() [1/2]
| void LoggingBaseClass::logHex |
( |
const char * |
file, |
|
|
int |
lineNumber, |
|
|
Log::LogLevel |
level, |
|
|
const Log::LogCategory & |
category, |
|
|
const QByteArray & |
data, |
|
|
const QString & |
tag = QString() |
|
) |
| const |
|
protected |
Write a hex dump to the system logger using an explicit category.
- Parameters
-
| file | Source filename |
| lineNumber | Source line number |
| level | Severity level |
| category | Explicit log category |
| data | Bytes to dump |
| tag | Optional label |
◆ logHex() [2/2]
| void LoggingBaseClass::logHex |
( |
const char * |
file, |
|
|
int |
lineNumber, |
|
|
Log::LogLevel |
level, |
|
|
const QByteArray & |
data, |
|
|
const QString & |
tag = QString() |
|
) |
| const |
|
protected |
Write a hex dump to the system logger.
- Parameters
-
| file | Source filename |
| lineNumber | Source line number |
| level | Severity level |
| data | Bytes to dump |
| tag | Optional label |
◆ logText() [1/2]
| void LoggingBaseClass::logText |
( |
const char * |
file, |
|
|
int |
lineNumber, |
|
|
Log::LogLevel |
level, |
|
|
const Log::LogCategory & |
category, |
|
|
const QString & |
text |
|
) |
| const |
|
protected |
Write a text message to the system logger using an explicit category.
- Parameters
-
| file | Source filename |
| lineNumber | Source line number |
| level | Severity level |
| category | Explicit log category |
| text | Message text |
◆ logText() [2/2]
| void LoggingBaseClass::logText |
( |
const char * |
file, |
|
|
int |
lineNumber, |
|
|
Log::LogLevel |
level, |
|
|
const QString & |
text |
|
) |
| const |
|
protected |
Write a text message to the system logger using the base category.
- Parameters
-
| file | Source filename (use FILE / LVL_* macros) |
| lineNumber | Source line number |
| level | Severity level |
| text | Message text |
◆ LVL0()
Return the base (level 0) log category.
- Returns
- Base log category.
Definition at line 47 of file loggingbaseclass.h.
◆ LVL1()
Return the level-1 sub-category.
- Returns
- Level-1 log category.
Definition at line 50 of file loggingbaseclass.h.
◆ LVL2()
Return the level-2 sub-category.
- Returns
- Level-2 log category.
Definition at line 53 of file loggingbaseclass.h.
◆ LVL3()
Return the level-3 sub-category.
- Returns
- Level-3 log category.
Definition at line 56 of file loggingbaseclass.h.
◆ removeLogConsumer()
| void LoggingBaseClass::removeLogConsumer |
( |
LogConsumer * |
consumer | ) |
|
|
protected |
Remove a previously added log consumer.
- Parameters
-
| consumer | Consumer to remove |
The documentation for this class was generated from the following file: