#include <fileappender.h>
Public Member Functions | |
FileAppender (QObject *pParent=0) | |
FileAppender (Layout *pLayout, const QString &rFileName, QObject *pParent=0) | |
FileAppender (Layout *pLayout, const QString &rFileName, bool append, QObject *pParent=0) | |
FileAppender (Layout *pLayout, const QString &rFileName, bool append, bool buffered, QObject *pParent=0) | |
virtual | ~FileAppender () |
bool | appendFile () const |
QString | file () const |
bool | bufferedIo () const |
void | setAppendFile (bool append) |
void | setBufferedIo (bool buffered) |
void | setFile (const QString &rFileName) |
virtual void | activateOptions () |
virtual void | close () |
Protected Member Functions | |
virtual bool | checkEntryConditions () const |
void | closeFile () |
virtual QDebug | debug (QDebug &rDebug) const |
virtual bool | handleIoErrors () const |
void | openFile () |
bool | removeFile (QFile &rFile) const |
bool | renameFile (QFile &rFile, const QString &rFileName) const |
Properties | |
bool | appendFile |
bool | bufferedIo |
QString | file |
The ownership and lifetime of objects of this class are managed. See Object ownership for more details.
Log4Qt::FileAppender::FileAppender | ( | QObject * | pParent = 0 |
) |
Log4Qt::FileAppender::FileAppender | ( | Layout * | pLayout, | |
const QString & | rFileName, | |||
QObject * | pParent = 0 | |||
) |
Log4Qt::FileAppender::FileAppender | ( | Layout * | pLayout, | |
const QString & | rFileName, | |||
bool | append, | |||
QObject * | pParent = 0 | |||
) |
Log4Qt::FileAppender::FileAppender | ( | Layout * | pLayout, | |
const QString & | rFileName, | |||
bool | append, | |||
bool | buffered, | |||
QObject * | pParent = 0 | |||
) |
virtual Log4Qt::FileAppender::~FileAppender | ( | ) | [virtual] |
bool Log4Qt::FileAppender::appendFile | ( | ) | const |
QString Log4Qt::FileAppender::file | ( | ) | const |
bool Log4Qt::FileAppender::bufferedIo | ( | ) | const |
void Log4Qt::FileAppender::setAppendFile | ( | bool | append | ) | [inline] |
void Log4Qt::FileAppender::setBufferedIo | ( | bool | buffered | ) | [inline] |
void Log4Qt::FileAppender::setFile | ( | const QString & | rFileName | ) | [inline] |
References Log4Qt::AppenderSkeleton::mObjectGuard.
virtual void Log4Qt::FileAppender::activateOptions | ( | ) | [virtual] |
virtual void Log4Qt::FileAppender::close | ( | ) | [virtual] |
Reimplemented from Log4Qt::WriterAppender.
virtual bool Log4Qt::FileAppender::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 WriterAppender::checkEntryConditions() is returned.
The checked conditions are:
The function is called as part of the checkEntryConditions() chain started by AppenderSkeleton::doAppend().
Reimplemented from Log4Qt::WriterAppender.
Reimplemented in Log4Qt::DailyRollingFileAppender.
void Log4Qt::FileAppender::closeFile | ( | ) | [protected] |
virtual QDebug Log4Qt::FileAppender::debug | ( | QDebug & | rDebug | ) | const [protected, virtual] |
Writes all object member variables to the given debug stream rDebug and returns the stream.
FileAppender(name:"FA" appendfile:false bufferedio:true encoding:"" file:"/log.txt" filter: 0x0 immediateflush:true isactive:false isclosed:false layout:"TTCC" referencecount:2 threshold:"NULL" writer:0x0)
Reimplemented from Log4Qt::WriterAppender.
Reimplemented in Log4Qt::DailyRollingFileAppender, and Log4Qt::RollingFileAppender.
virtual bool Log4Qt::FileAppender::handleIoErrors | ( | ) | const [protected, virtual] |
Checks for file I/O errrors. If an error is found it is logged and the function returns true. Otherwise false is returned.
Reimplemented from Log4Qt::WriterAppender.
void Log4Qt::FileAppender::openFile | ( | ) | [protected] |
Opens the file for the appender based on the specified file name and mode. A text stream is created and passed on to the super class WriterAppender.
If the parent directory of the specified file does not exists, it is created.
bool Log4Qt::FileAppender::removeFile | ( | QFile & | rFile | ) | const [protected] |
Removes the file rFile. If the operation is successful, true is returned. Otherwise an APPENDER_REMOVE_FILE_ERROR error is logged and false is returned.
bool Log4Qt::FileAppender::renameFile | ( | QFile & | rFile, | |
const QString & | rFileName | |||
) | const [protected] |
Renames the file rFile to rFileName. If the operation is successful, true is returned. Otherwise an APPENDER_RENAMING_FILE_ERROR error is logged and false is returned.
bool Log4Qt::FileAppender::appendFile [inline, read, write] |
The property holds, if the output is appended to the file.
The default is false for not appending.
bool Log4Qt::FileAppender::bufferedIo [inline, read, write] |
The property holds, if the output is buffered.
The default is true for buffering.
QString Log4Qt::FileAppender::file [inline, read, write] |