• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

qca

QCA::Logger

QCA::Logger Class Reference
[QCA user API]

#include <QtCrypto>

Inheritance diagram for QCA::Logger:

Inheritance graph
[legend]

List of all members.


Detailed Description

A simple logging system.

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).

Definition at line 954 of file qca_support.h.


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

QStringList currentLogDevices () const
Severity level () const
void logBinaryMessage (const QByteArray &blob, Severity=Information)
void logTextMessage (const QString &message, Severity=Information)
void registerLogDevice (AbstractLogDevice *logger)
void setLevel (Severity level)
void unregisterLogDevice (const QString &loggerName)

Member Enumeration Documentation

enum QCA::Logger::Severity

The severity of the message.

This information may be used by the log device to determine what the appropriate action is.

Enumerator:
Quiet  Quiet: turn of logging.
Emergency  Emergency: system is unusable.
Alert  Alert: action must be taken immediately.
Critical  Critical: critical conditions.
Error  Error: error conditions.
Warning  Warning: warning conditions.
Notice  Notice: normal but significant condition.
Information  Informational: informational messages.
Debug  Debug: debug-level messages.

Definition at line 964 of file qca_support.h.


Member Function Documentation

QStringList QCA::Logger::currentLogDevices (  )  const

Get a list of the names of all registered log devices.

Definition at line 61 of file logger.cpp.

Severity QCA::Logger::level (  )  const [inline]

Get the current logging level.

Returns:
Current level

Definition at line 982 of file qca_support.h.

void QCA::Logger::logBinaryMessage ( const QByteArray &  blob,
Severity  severity = Information 
)

Log a binary blob to all available log devices.

Parameters:
blob the information to log
Note:
how this is handled is quite logger specific. For example, it might be logged as a binary, or it might be encoded in some way

Definition at line 107 of file logger.cpp.

void QCA::Logger::logTextMessage ( const QString &  message,
Severity  severity = Information 
)

Log a message to all available log devices.

Parameters:
message the text to log

Definition at line 97 of file logger.cpp.

void QCA::Logger::registerLogDevice ( AbstractLogDevice *  logger  ) 

Add an AbstractLogDevice subclass to the existing list of loggers.

Parameters:
logger the LogDevice to add

Definition at line 66 of file logger.cpp.

void QCA::Logger::setLevel ( Severity  level  ) 

Set the current logging level.

Parameters:
level new logging level
Only severities less or equal than the log level one will be logged

Definition at line 92 of file logger.cpp.

void QCA::Logger::unregisterLogDevice ( const QString &  loggerName  ) 

Remove an AbstractLogDevice subclass from the existing list of loggers.

Parameters:
loggerName the name of the LogDevice to remove
Note:
If there are several log devices with the same name, all will be removed.

Definition at line 72 of file logger.cpp.


The documentation for this class was generated from the following files:
  • qca_support.h
  • logger.cpp

qca

Skip menu "qca"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • akonadi
  • Decibel
  • eigen
  • Eigen2
  • kdewin32
  • Phonon
  •     Backend
  • qca
  • qimageblitz
  • soprano
  • strigi
  •     searchclient
  •     streamanalyzer
  •     streams
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal