#include <qca_support.h>
Inheritance diagram for QCA::Logger:
Public Types | |
enum | Severity { Quiet = 0, Emergency = 1, Alert = 2, Critical = 3, Error = 4, Warning = 5, Notice = 6, Information = 7, Debug = 8 } |
Public Member Functions | |
Logger::Severity | level () const |
void | setLevel (Logger::Severity level) |
void | logTextMessage (const QString &message, Severity=Information) |
void | logBinaryMessage (const QByteArray &blob, Severity=Information) |
void | registerLogDevice (AbstractLogDevice *logger) |
void | unregisterLogDevice (const QString &loggerName) |
QStringList | currentLogDevices () const |
Friends | |
class | Global |
This class provides a simple but flexible approach to logging information that may be used for debugging or system operation diagnostics.
There is a single Logger for each application that uses QCA. You do not need to create this Logger yourself - QCA automatically creates it on startup. You can get access to the Logger using the global QCA::logger() method.
By default the Logger just accepts all messages (binary and text). If you want to get access to those messages, you need to subclass AbstractLogDevice, and register your subclass (using registerLogDevice()). You can then take whatever action is appropriate (e.g. show to the user using the GUI, log to a file or send to standard error).
|
|
Get the current logging level.
|
|
Set the current logging level.
|
|
Log a message to all available log devices.
|
|
Log a binary blob to all available log devices.
|
|
Add an AbstractLogDevice subclass to the existing list of loggers.
|
|
Remove an AbstractLogDevice subclass from the existing list of loggers.
|
|
Get a list of the names of all registered log devices.
|