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