MythTV  master
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
FileLogger Class Reference

File-based logger - used for logfiles and console. More...

#include <loggingserver.h>

Inheritance diagram for FileLogger:
Inheritance graph
[legend]
Collaboration diagram for FileLogger:
Collaboration graph
[legend]

Public Member Functions

 FileLogger (const char *filename)
 FileLogger constructor. More...
 
 ~FileLogger ()
 FileLogger deconstructor - close the logfile. More...
 
bool logmsg (LoggingItem *item) override
 Process a log message, writing to the logfile. More...
 
void reopen (void) override
 Reopen the logfile after a SIGHUP. More...
 
- Public Member Functions inherited from LoggerBase
 LoggerBase (const char *string)
 LoggerBase Constructor. More...
 
virtual ~LoggerBase ()
 LoggerBase Deconstructor. More...
 
virtual void stopDatabaseAccess (void)
 Stop logging to the database. More...
 

Static Public Member Functions

static FileLoggercreate (const QString &filename, QMutex *mutex)
 

Private Attributes

bool m_opened {false}
 true when the logfile is opened More...
 
int m_fd {-1}
 contains the file descriptor for the logfile More...
 

Additional Inherited Members

- Protected Attributes inherited from LoggerBase
char * m_handle {nullptr}
 semi-opaque handle for identifying instance More...
 

Detailed Description

File-based logger - used for logfiles and console.

Definition at line 48 of file loggingserver.h.

Constructor & Destructor Documentation

◆ FileLogger()

FileLogger::FileLogger ( const char *  filename)
explicit

FileLogger constructor.

Parameters
filenameFilename of the logfile.

Definition at line 123 of file loggingserver.cpp.

Referenced by create().

◆ ~FileLogger()

FileLogger::~FileLogger ( )

FileLogger deconstructor - close the logfile.

Definition at line 134 of file loggingserver.cpp.

Member Function Documentation

◆ logmsg()

bool FileLogger::logmsg ( LoggingItem item)
overridevirtual

Process a log message, writing to the logfile.

Parameters
itemLoggingItem containing the log message to process

Implements LoggerBase.

Definition at line 180 of file loggingserver.cpp.

◆ reopen()

void FileLogger::reopen ( void  )
overridevirtual

Reopen the logfile after a SIGHUP.

Log files only (no console). This allows for logrollers to be used.

Implements LoggerBase.

Definition at line 169 of file loggingserver.cpp.

◆ create()

FileLogger * FileLogger::create ( const QString &  filename,
QMutex *  mutex 
)
static

Definition at line 146 of file loggingserver.cpp.

Referenced by LogForwardThread::forwardMessage().

Member Data Documentation

◆ m_opened

bool FileLogger::m_opened {false}
private

true when the logfile is opened

Definition at line 59 of file loggingserver.h.

Referenced by FileLogger(), logmsg(), reopen(), and ~FileLogger().

◆ m_fd

int FileLogger::m_fd {-1}
private

contains the file descriptor for the logfile

Definition at line 60 of file loggingserver.h.

Referenced by FileLogger(), logmsg(), reopen(), and ~FileLogger().


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