mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-03-12 05:25:23 -07:00
38 lines
672 B
C++
38 lines
672 B
C++
// SPDX-License-Identifier: LicenseRef-AGPL-3.0-only-OpenSSL
|
|
|
|
#ifndef CHIAKI_SESSIONLOG_H
|
|
#define CHIAKI_SESSIONLOG_H
|
|
|
|
#include <chiaki/log.h>
|
|
|
|
#include <QString>
|
|
#include <QDir>
|
|
#include <QMutex>
|
|
|
|
class QFile;
|
|
class StreamSession;
|
|
|
|
class SessionLog
|
|
{
|
|
friend class SessionLogPrivate;
|
|
|
|
private:
|
|
StreamSession *session;
|
|
ChiakiLog log;
|
|
QFile *file;
|
|
QMutex file_mutex;
|
|
|
|
void Log(ChiakiLogLevel level, const char *msg);
|
|
|
|
public:
|
|
SessionLog(StreamSession *session, uint32_t level_mask, const QString &filename);
|
|
~SessionLog();
|
|
|
|
ChiakiLog *GetChiakiLog() { return &log; }
|
|
};
|
|
|
|
QString GetLogBaseDir();
|
|
QString CreateLogFilename();
|
|
|
|
#endif //CHIAKI_SESSIONLOG_H
|