mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-26 00:23:55 -07:00
Fix crash on logger; make log window modalless (#2659)
This commit is contained in:
parent
9dd3a04a08
commit
ce77d51a8f
6 changed files with 39 additions and 18 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include <QFile>
|
||||
#include <QVector>
|
||||
#include <QString>
|
||||
#include <QMutex>
|
||||
|
||||
class Logger : public QObject {
|
||||
Q_OBJECT
|
||||
|
|
@ -24,15 +25,17 @@ private:
|
|||
bool logToFileEnabled;
|
||||
QTextStream fileStream;
|
||||
QFile fileHandle;
|
||||
|
||||
QList<QString> logBuffer;
|
||||
QMutex mutex;
|
||||
public:
|
||||
void logToFile(bool enabled);
|
||||
void log(QtMsgType type, const QMessageLogContext &ctx, const QString &message);
|
||||
void log(QtMsgType type, const QMessageLogContext &ctx, const QString message);
|
||||
QList<QString> getLogBuffer() { return logBuffer; }
|
||||
protected:
|
||||
void openLogfileSession();
|
||||
void closeLogfileSession();
|
||||
protected slots:
|
||||
void internalLog(const QString message);
|
||||
signals:
|
||||
void logEntryAdded(QString message);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue