1 #ifndef TORCLOGGINGIMP_H 2 #define TORCLOGGINGIMP_H 4 #define LOGLINE_MAX (2048-120) 8 #include <QWaitCondition> 31 bool Flush(
int TimeoutMS = 200000);
35 QWaitCondition m_waitNotEmpty;
36 QWaitCondition m_waitEmpty;
46 virtual bool Logmsg(
LogItem *Item) = 0;
49 virtual bool PrintLine (QByteArray &Line) = 0;
50 QByteArray GetLine(
LogItem *Item);
62 FileLogger(
const QString &Filename,
bool ErrorsOnly,
int Quiet);
65 bool Logmsg(
LogItem *Item)
override;
68 bool PrintLine (QByteArray &Line)
override;
80 Q_CLASSINFO(
"Version",
"1.0.0")
81 Q_CLASSINFO(
"GetLog",
"type=Log,methods=GET+AUTH")
82 Q_CLASSINFO(
"GetTail",
"type=Logline,methods=GET+AUTH")
83 Q_PROPERTY(QByteArray log READ GetLog NOTIFY logChanged)
84 Q_PROPERTY(QByteArray tail READ GetTail NOTIFY tailChanged)
87 explicit
WebLogger(const QString &Filename);
90 bool Logmsg (
LogItem *Item) override;
93 bool event (QEvent *event) override;
94 void SubscriberDeleted (QObject *Subscriber);
95 QByteArray GetLog (
void);
96 QByteArray GetTail (
void);
99 void logChanged (
void);
100 void tailChanged (
void);
108 #endif // TORCLOGGINGIMP_H bool Flush(int TimeoutMS=200000)
void RegisterLoggingThread(void)
Serves log content to registered subscribers and HTTP clients.
void HandleItem(LogItem *Item)
A Torc specific wrapper around QThread.
void DeregisterLoggingThread(void)