Log4Qt::LogObject Class Reference

The class LogObject is the common base class for many classes in the package. More...

#include <logobject.h>

Inheritance diagram for Log4Qt::LogObject:

Log4Qt::Appender Log4Qt::Filter Log4Qt::Layout Log4Qt::AppenderSkeleton Log4Qt::DenyAllFilter Log4Qt::LevelMatchFilter Log4Qt::LevelRangeFilter Log4Qt::StringMatchFilter Log4Qt::PatternLayout Log4Qt::SimpleLayout Log4Qt::TTCCLayout

List of all members.

Public Member Functions

 LogObject (QObject *pObject=0)
virtual ~LogObject ()
int referenceCount () const
void release ()
void retain ()

Protected Member Functions

virtual QDebug debug (QDebug &rDebug) const =0
Loggerlogger () const

Friends

QDebug operator<< (QDebug debug, const LogObject &rLogObject)


Detailed Description

The class LogObject is the common base class for many classes in the package.

The class inherits QObject to allow its subclass to be accessed using the Qt property system.

LogObject objects provide a reference counter. A reference to the object is established by calling retain() and freed by calling release(). The object will delete itself when the reference counter is decremented to 0.

A class specific logger can be accessed over logger().

The class also implements generic streaming to QDebug. Streaming an object to QDebug will invoke debug() to create class specific output.

Note:
All the functions declared in this class are thread-safe.
See also:
Object ownership, LOG4QT_DECLARE_QCLASS_LOGGER

Constructor & Destructor Documentation

Log4Qt::LogObject::LogObject ( QObject *  pObject = 0  )  [inline]

Creates a LogObject which is a child of pObject.

Log4Qt::LogObject::~LogObject (  )  [inline, virtual]

Destroys the LogObject.


Member Function Documentation

int Log4Qt::LogObject::referenceCount (  )  const [inline]

Returns the value of the reference counter.

void Log4Qt::LogObject::release (  )  [inline]

Decrements the reference count of the object. If the reference count count reaches zero and the object does not have a parent the object is deleted.

void Log4Qt::LogObject::retain (  )  [inline]

Increments the reference count of the object.

virtual QDebug Log4Qt::LogObject::debug ( QDebug &  rDebug  )  const [protected, pure virtual]

Logger * Log4Qt::LogObject::logger (  )  const [inline, protected]

Returns a pointer to a Logger named after of the object.

See also:
Logger::logger(const char *pName)

References Log4Qt::ClassLogger::logger().


Friends And Related Function Documentation

QDebug operator<< ( QDebug  debug,
const LogObject rLogObject 
) [friend]

Writes all object member variables to the given debug stream debug and returns the stream.

To handle sub-classing the function uses the virtual member function debug(). This allows each class to generate its own output.

See also:
QDebug, debug()


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

Generated on Sun Mar 1 16:40:45 2009 for Log4Qt by  doxygen 1.5.6