4#ifndef LOGGINGBASECLASS_H
5#define LOGGINGBASECLASS_H
7#include <Kanoop/logcategory.h>
9#include <Kanoop/logconsumer.h>
10#include <Kanoop/kanoopcommon.h>
13#define UNIMPLEMENTED logText(LVL_WARNING, QString("---------------- %1 UNIMPLEMENTED ----------------").arg(__FUNCTION__));
85 void logHex(
const char* file,
int lineNumber,
Log::LogLevel level,
const QByteArray& data,
const QString& tag = QString())
const;
A QObject-based sink that receives log entries from the logging system.
A named logging category with an associated minimum log level.
Mixin base class providing categorized logging at four nesting levels.
LoggingBaseClass(const QString &category)
Construct with a category name string.
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.
LoggingBaseClass(const Log::LogCategory &category=Log::LogCategory())
Construct with an optional log 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.
Log::LogCategory LVL2() const
Return the level-2 sub-category.
Log::LogCategory logCategory() const
Return the base log 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 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.
Log::LogCategory LVL0() const
Return the base (level 0) log category.
void removeLogConsumer(LogConsumer *consumer)
Remove a previously added log consumer.
Log::LogCategory LVL1() const
Return the level-1 sub-category.
LogLevel
Severity levels for log messages, ordered from most to least critical.