#include <writerappender.h>
Public Member Functions | |
WriterAppender (QObject *pParent=0) | |
WriterAppender (Layout *pLayout, QObject *pParent=0) | |
WriterAppender (Layout *pLayout, QTextStream *pTextStream, QObject *pParent=0) | |
virtual | ~WriterAppender () |
virtual bool | requiresLayout () const |
QTextCodec * | encoding () const |
bool | immediateFlush () const |
QTextStream * | writer () const |
void | setEncoding (QTextCodec *pTextCodec) |
void | setImmediateFlush (bool immediateFlush) |
void | setWriter (QTextStream *pTextStream) |
virtual void | activateOptions () |
virtual void | close () |
Protected Member Functions | |
virtual void | append (const LoggingEvent &rEvent) |
virtual bool | checkEntryConditions () const |
void | closeWriter () |
virtual QDebug | debug (QDebug &rDebug) const |
virtual bool | handleIoErrors () const |
void | writeFooter () const |
void | writeHeader () const |
Properties | |
QTextCodec | encoding |
QTextStream | writer |
bool | immediateFlush |
The ownership and lifetime of objects of this class are managed. See Object ownership for more details.
Log4Qt::WriterAppender::WriterAppender | ( | QObject * | pParent = 0 |
) |
Log4Qt::WriterAppender::WriterAppender | ( | Layout * | pLayout, | |
QObject * | pParent = 0 | |||
) |
Log4Qt::WriterAppender::WriterAppender | ( | Layout * | pLayout, | |
QTextStream * | pTextStream, | |||
QObject * | pParent = 0 | |||
) |
virtual Log4Qt::WriterAppender::~WriterAppender | ( | ) | [virtual] |
virtual bool Log4Qt::WriterAppender::requiresLayout | ( | ) | const [virtual] |
Implements Log4Qt::Appender.
QTextCodec* Log4Qt::WriterAppender::encoding | ( | ) | const |
bool Log4Qt::WriterAppender::immediateFlush | ( | ) | const |
QTextStream* Log4Qt::WriterAppender::writer | ( | ) | const |
void Log4Qt::WriterAppender::setEncoding | ( | QTextCodec * | pTextCodec | ) |
Sets the codec used by the writer to pTextCoded.
If a codec is set with setEncoding, it will overwrite the codec set in the text stream. A subsequent call with pTextCoded equals null will resets the codec to the default QTextCodec::codecForLocale().
void Log4Qt::WriterAppender::setImmediateFlush | ( | bool | immediateFlush | ) | [inline] |
void Log4Qt::WriterAppender::setWriter | ( | QTextStream * | pTextStream | ) |
virtual void Log4Qt::WriterAppender::activateOptions | ( | ) | [virtual] |
Reimplemented from Log4Qt::AppenderSkeleton.
Reimplemented in Log4Qt::ConsoleAppender, Log4Qt::DailyRollingFileAppender, and Log4Qt::FileAppender.
virtual void Log4Qt::WriterAppender::close | ( | ) | [virtual] |
Reimplemented from Log4Qt::AppenderSkeleton.
Reimplemented in Log4Qt::ConsoleAppender, and Log4Qt::FileAppender.
virtual void Log4Qt::WriterAppender::append | ( | const LoggingEvent & | rEvent | ) | [protected, virtual] |
Implements Log4Qt::AppenderSkeleton.
Reimplemented in Log4Qt::DailyRollingFileAppender, and Log4Qt::RollingFileAppender.
virtual bool Log4Qt::WriterAppender::checkEntryConditions | ( | ) | const [protected, virtual] |
Tests if all entry conditions for using append() in this class are met.
If a conditions is not met, an error is logged and the function returns false. Otherwise the result of AppenderSkeleton::checkEntryConditions() is returned.
The checked conditions are:
The function is called as part of the checkEntryConditions() chain started by AppenderSkeleton::doAppend().
Reimplemented from Log4Qt::AppenderSkeleton.
Reimplemented in Log4Qt::DailyRollingFileAppender, and Log4Qt::FileAppender.
void Log4Qt::WriterAppender::closeWriter | ( | ) | [protected] |
virtual QDebug Log4Qt::WriterAppender::debug | ( | QDebug & | rDebug | ) | const [protected, virtual] |
Writes all object member variables to the given debug stream rDebug and returns the stream.
WriterAppender(name:"WA" encoding:"" immediateFlush:true isactive:false isclosed:false layout:"TTCC" referencecount:1 threshold:"NULL" writer:0x0)
Implements Log4Qt::LogObject.
Reimplemented in Log4Qt::ConsoleAppender, Log4Qt::DailyRollingFileAppender, Log4Qt::FileAppender, and Log4Qt::RollingFileAppender.
virtual bool Log4Qt::WriterAppender::handleIoErrors | ( | ) | const [protected, virtual] |
Reimplemented in Log4Qt::FileAppender.
void Log4Qt::WriterAppender::writeFooter | ( | ) | const [protected] |
void Log4Qt::WriterAppender::writeHeader | ( | ) | const [protected] |
QTextCodec * Log4Qt::WriterAppender::encoding [inline, read, write] |
The property holds the codec the appender uses.
The default is null to use the codec the writer has set.
QTextStream * Log4Qt::WriterAppender::writer [inline, read, write] |
bool Log4Qt::WriterAppender::immediateFlush [inline, read, write] |
The property holds, if the writer flushes after all write operations.
The default is true for flushing.