Go to the documentation of this file. 1 #ifndef LOGGINGSERVER_H_
2 #define LOGGINGSERVER_H_
4 #include <QMutexLocker>
5 #include <QSocketNotifier>
8 #include <QElapsedTimer>
15 #include "mythconfig.h"
36 virtual void reopen(
void) = 0;
48 void reopen(
void)
override;
59 explicit SyslogLogger(
bool open);
60 ~SyslogLogger()
override;
63 void reopen(
void)
override { }
64 static SyslogLogger *create(QMutex *mutex,
bool open =
true);
66 bool m_opened {
false};
70 #if CONFIG_SYSTEMD_JOURNAL
75 ~JournalLogger()
override;
78 void reopen(
void)
override { };
79 static JournalLogger *create(QMutex *mutex);
95 void run(
void)
override;
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Base class for the various logging mechanisms.
MBASE_PUBLIC void logForwardMessage(LoggingItem *item)
bool logmsg(LoggingItem *item) override
Process a log message, writing to the logfile.
virtual ~LoggerBase()
LoggerBase Deconstructor.
bool m_aborted
Flag to abort the thread.
The logging items that are generated by LOG() and are sent to the console.
MBASE_PUBLIC void logForwardStop(void)
The logging thread that forwards received messages to the consuming loggers via ZeroMQ.
~LogForwardThread() override
LogForwardThread destructor.
static void handleSigHup(void)
SIGHUP handler - reopen all open logfiles for logrollers.
void run(void) override
Run the log forwarding thread.
QString m_handle
semi-opaque handle for identifying instance
LoggerBase(const char *string)
LoggerBase Constructor.
std::ofstream m_ofstream
Output file stream for the log file.
LogForwardThread()
LogForwardThread constructor.
static void forwardMessage(LoggingItem *item)
File-based logger - used for logfiles and console.
void stop(void)
Stop the thread by setting the abort flag.
~FileLogger() override
FileLogger deconstructor - close the logfile.
This is a wrapper around QThread that does several additional things.
QList< LoggingItem * > LoggingItemList
virtual bool logmsg(LoggingItem *item)=0
Process a log message for the logger instance.
virtual void reopen(void)=0
Reopen the log file to facilitate log rolling.
FileLogger(const char *filename)
FileLogger constructor.
void incomingSigHup(void)
void reopen(void) override
Reopen the logfile after a SIGHUP.
friend void logSigHup(void)
static FileLogger * create(const QString &filename, QMutex *mutex)
MBASE_PUBLIC bool logForwardStart(void)