#include <logobject.h>
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 |
Logger * | logger () const |
Friends | |
QDebug | operator<< (QDebug debug, const LogObject &rLogObject) |
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.
Log4Qt::LogObject::LogObject | ( | QObject * | pObject = 0 |
) | [inline] |
Creates a LogObject which is a child of pObject.
Log4Qt::LogObject::~LogObject | ( | ) | [inline, virtual] |
Destroys the LogObject.
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] |
Writes all object member variables to the given debug stream rDebug and returns the stream.
The member function is used by QDebug operator<<(QDebug debug, const LogObject &rLogObject) to generate class specific output.
Implemented in Log4Qt::ConsoleAppender, Log4Qt::DailyRollingFileAppender, Log4Qt::FileAppender, Log4Qt::PatternLayout, Log4Qt::RollingFileAppender, Log4Qt::SimpleLayout, Log4Qt::TTCCLayout, Log4Qt::DebugAppender, Log4Qt::DenyAllFilter, Log4Qt::LevelMatchFilter, Log4Qt::LevelRangeFilter, Log4Qt::ListAppender, Log4Qt::NullAppender, Log4Qt::StringMatchFilter, and Log4Qt::WriterAppender.
Logger * Log4Qt::LogObject::logger | ( | ) | const [inline, protected] |
Returns a pointer to a Logger named after of the object.
References Log4Qt::ClassLogger::logger().
QDebug operator<< | ( | QDebug | debug, | |
const LogObject & | rLogObject | |||
) | [friend] |