CuteLogger
Fast and simple logging solution for Qt based applications
Public Member Functions | Protected Member Functions | List of all members
FileAppender Class Reference

Simple appender that writes the log records to the plain text file. More...

Inheritance diagram for FileAppender:
AbstractStringAppender AbstractAppender RollingFileAppender

Public Member Functions

 FileAppender (const QString &fileName=QString())
 Constructs the new file appender assigned to file with the given name.
 
QString fileName () const
 Returns the name set by setFileName() or to the FileAppender constructor. More...
 
void setFileName (const QString &)
 Sets the name of the file. The name can have no path, a relative path, or an absolute path. More...
 
- Public Member Functions inherited from AbstractStringAppender
 AbstractStringAppender ()
 Constructs a new string appender object.
 
virtual QString format () const
 Returns the current log format string. More...
 
void setFormat (const QString &)
 Sets the logging format for writing strings to the log target with this appender. More...
 
- Public Member Functions inherited from AbstractAppender
 AbstractAppender ()
 Constructs a AbstractAppender object.
 
virtual ~AbstractAppender ()
 Destructs the AbstractAppender object.
 
Logger::LogLevel detailsLevel () const
 Returns the current details level of appender. More...
 
void setDetailsLevel (Logger::LogLevel level)
 Sets the current details level of appender. More...
 
void setDetailsLevel (const QString &level)
 Sets the current details level of appender. More...
 
void write (const QDateTime &timeStamp, Logger::LogLevel logLevel, const char *file, int line, const char *function, const QString &category, const QString &message)
 Tries to write the log record to this logger. More...
 

Protected Member Functions

virtual void append (const QDateTime &timeStamp, Logger::LogLevel logLevel, const char *file, int line, const char *function, const QString &category, const QString &message)
 Write the log record to the file. More...
 
- Protected Member Functions inherited from AbstractStringAppender
QString formattedString (const QDateTime &timeStamp, Logger::LogLevel logLevel, const char *file, int line, const char *function, const QString &category, const QString &message) const
 Returns the string to record to the logging target, formatted according to the format(). More...
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractStringAppender
static QString stripFunctionName (const char *)
 Strips the long function signature (as added by Q_FUNC_INFO macro) More...
 

Detailed Description

Simple appender that writes the log records to the plain text file.

Member Function Documentation

◆ append()

void FileAppender::append ( const QDateTime &  timeStamp,
Logger::LogLevel  logLevel,
const char *  file,
int  line,
const char *  function,
const QString &  category,
const QString &  message 
)
protectedvirtual

Write the log record to the file.

See also
fileName()
AbstractStringAppender::format()

Implements AbstractAppender.

Reimplemented in RollingFileAppender.

◆ fileName()

QString FileAppender::fileName ( ) const

Returns the name set by setFileName() or to the FileAppender constructor.

See also
setFileName()

◆ setFileName()

void FileAppender::setFileName ( const QString &  s)

Sets the name of the file. The name can have no path, a relative path, or an absolute path.

See also
fileName()

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